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

27 lines
721 B
Twig
Raw Normal View History

2023-01-10 20:14:28 +01:00
{% if "events" in page.url %}
2023-01-10 21:28:33 +01:00
2023-01-10 21:51:39 +01:00
{% set tags = page.collection().group('tags') %}
{% set top5tags = tags|slice(0, 5) %}
<ul>
{% for tag in top5tags %}
<li>{{ tag.name }} ({{ tag.count }})</li>
2023-01-10 21:28:33 +01:00
{% endfor %}
2023-01-10 21:51:39 +01:00
</ul>
2023-01-10 21:28:33 +01:00
2023-01-10 21:39:28 +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 %}