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

37 lines
1.0 KiB
Twig
Raw Normal View History

2023-01-10 22:14:16 +01:00
2023-01-10 20:14:28 +01:00
{% if "events" in page.url %}
2023-01-10 22:25:12 +01:00
{% set filter = true %}
{% set filterstart = 0 %}
{% set filterend = 5 %}
2023-01-10 22:26:14 +01:00
{% set taxlist = page.collection.taxonomylist.get %}
2023-01-10 22:10:56 +01:00
2023-01-10 22:22:38 +01:00
{% if taxlist %}
{% set taxlist_taxonomy = taxlist[taxonomy] %}
2023-01-10 22:13:15 +01:00
2023-01-10 22:22:38 +01:00
{% if filter %}
{% set taxlist_taxonomy = taxlist_taxonomy|slice(filterstart,filterend) %}
{% endif %}
2023-01-10 22:13:15 +01:00
2023-01-10 22:22:38 +01:00
<span class="tags">
{% for tax,value in taxlist_taxonomy %}
<a href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax|e('url') }}">{{ tax }}</a>
{% endfor %}
</span>
{% endif %}
2023-01-10 21:28:33 +01:00
2023-01-10 22:04:21 +01:00
2023-01-10 20:03:24 +01:00
{% else %}
2023-01-10 20:38:30 +01:00
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
2023-01-10 20:03:24 +01:00
{% endif %}
2023-01-10 20:13:33 +01:00
{% if taxlist %}
2023-01-10 21:46:02 +01:00
<span class="tags">2
{% 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 %}