39 lines
1.1 KiB
Twig
39 lines
1.1 KiB
Twig
{% if "events" in page.url %}
|
|
|
|
|
|
{% set pages = page.collection() %}
|
|
{% set tag_count = {} %}
|
|
|
|
{% for p in pages %}
|
|
{% for tag in p.taxonomy.tags %}
|
|
{% if tag in tag_count %}
|
|
{% set tag_count = tag_count|merge({ (tag): tag_count[tag] + 1 }) %}
|
|
{% else %}
|
|
{% set tag_count = tag_count|merge({ (tag): 1 }) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
|
|
{% set most_common_tags = tag_count|sort(sort_flags.SORT_REGULAR)|reverse %}
|
|
|
|
|
|
<ul>2
|
|
{% for tag, count in most_common_tags %}
|
|
<li>{{ tag }} ({{ count }} occurrences)</li>
|
|
{% endfor %}
|
|
</ul>
|
|
|
|
{% else %}
|
|
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
|
|
{% endif %}
|
|
|
|
|
|
{% 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 %}
|