From 0187f273ed40c085605b83ddda7213db87db10b4 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 6 Mar 2017 08:36:59 +0000 Subject: [PATCH] Different sort order on talk pages --- source/_partials/talks-table.twig | 3 ++- source/talks.html.twig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/_partials/talks-table.twig b/source/_partials/talks-table.twig index 0a649a35..6a83839c 100644 --- a/source/_partials/talks-table.twig +++ b/source/_partials/talks-table.twig @@ -7,7 +7,8 @@ - {% for event in events|sortbyfield('date')|reverse %} + {% set events = reverse_order ? events|sortbyfield('date')|reverse : events|sortbyfield('date') %} + {% for event in events %} {{ event.date|date('j F Y') }} diff --git a/source/talks.html.twig b/source/talks.html.twig index 5950845a..08e778d2 100644 --- a/source/talks.html.twig +++ b/source/talks.html.twig @@ -20,4 +20,4 @@ use: [talks, posts] {% endfor %} {% endfor %} -{% include "talks-table" with { events: events, show_talk: true } %} +{% include "talks-table" with { events: events, show_talk: true, reverse_order: true } %}