grav/themes/quark/templates/partials/taxonomylist.html.twig

20 lines
673 B
Twig
Raw Normal View History

2023-01-10 20:26:03 +01:00
{% set collection = page.collection() %}
2023-01-10 20:14:28 +01:00
{% if "events" in page.url %}
2023-01-10 20:26:03 +01:00
{% set collection_filtered = collection|filter(page => page.header.event.start is defined) %}
{% set taxlist = taxonomylist.get(collection_filtered) %}
2023-01-10 20:21:39 +01:00
1
2023-01-10 20:03:24 +01:00
{% else %}
2023-01-10 20:26:03 +01:00
{% set taxlist = taxonomylist.get(collection) %}
2023-01-10 20:21:39 +01:00
2
2023-01-10 20:03:24 +01:00
{% endif %}
2023-01-10 20:13:33 +01:00
{% if taxlist %}
<span class="tags">
{% for tax,value in taxlist[taxonomy] %}
{% set label_class = uri.param(taxonomy) == tax ? 'label-primary' : 'label-secondary' %}
<a class="label label-rounded {{ label_class }}" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }}</a>
{% endfor %}
</span>
{% endif %}