Files
ks-twenty-fifteen/templates/partials/taxonomylist.html.twig
2024-05-07 14:12:27 +02:00

18 lines
731 B
Twig

{# Customized from taxonomylist plugin #}
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
{% set limit = 20 %} {# show only the first x items #}
{% set treshold = 1 %} {# at least this number of times used #}
{% if taxlist %}
<span class="tags">
{% set i = 0 %}
{% for tax,value in taxlist[taxonomy] if (((limit is not defined) or (i < limit)) and (treshold is not defined or (value >= treshold))) %}
{% set active = uri.param(taxonomy) == tax? 'active' : '' %}
<a class="{{ active }}" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }} ({{ value }})</a>
{% set i = i + 1 %}
{% endfor %}
</span>
{% endif %}