{% 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 %} {% else %} {% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %} {% endif %} {% if taxlist %} {% for tax,value in taxlist[taxonomy] %} {% set label_class = uri.param(taxonomy) == tax ? 'label-primary' : 'label-secondary' %} {{ tax }} {% endfor %} {% endif %}