From 56e482fb7aac78f050803005c6390f36b54918bf Mon Sep 17 00:00:00 2001 From: teldra Date: Tue, 10 Jan 2023 21:28:33 +0100 Subject: [PATCH] neues theme: add blueprints.yaml --- .../templates/partials/taxonomylist.html.twig | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/themes/quark/templates/partials/taxonomylist.html.twig b/themes/quark/templates/partials/taxonomylist.html.twig index 5aeb919e..73540521 100644 --- a/themes/quark/templates/partials/taxonomylist.html.twig +++ b/themes/quark/templates/partials/taxonomylist.html.twig @@ -1,5 +1,25 @@ {% if "events" in page.url %} - {% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags().where('event.start', 'exists') : taxonomylist.get().where('event.start', 'exists') %} + + + {% set pages = page.collection() %} + {% set taxonomy_count = {} %} + + {% for p in pages %} + {% for taxonomy in p.taxonomy %} + {% for value in p.taxonomy[taxonomy] %} + {% if taxonomy_count[value] is defined %} + {% set taxonomy_count = taxonomy_count|merge({ (value): taxonomy_count[value] + 1 }) %} + {% else %} + {% set taxonomy_count = taxonomy_count|merge({ (value): 1 }) %} + {% endif %} + {% endfor %} + {% endfor %} + {% endfor %} + + {% set most_common_taxonomies = taxonomy_count|sort(sort_flags.SORT_REGULAR)|reverse %} + + + {% set taxlist = most_common_taxonomies %} {% else %} {% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %} {% endif %}