Using Tagger and displaying the current tag selected

As the original poster noted, there is a snippet TaggerGetCurrentTag for this purpose.
With a call like this

[[!TaggerGetCurrentTag? &groupTpl=`@INLINE [[+tags]]` &tagTpl=`@INLINE [[+tag]]` &tagSeparator=`, ` ]]

you should get the same result.


The snippet TaggerGetTags already provides a placeholder active. So the same could be achieved with this call:

[[!TaggerGetTags? &groups=`1` &rowTpl=`TaglisteTpl`]]

Chunk TaglisteTpl:

<li>
  <a class="[[+active:is=`1`:then=`active`]]" href="[[+uri]]">[[+tag]]</a>
</li>

Make sure to call the snippets uncached. These solutions also works, if you select multiple tags (https://www.domain.com/resource?kategorie=tag1,tag2).

5 Likes