--- title: "Liquid filters: highlight_active_tag" description: |- Wraps a given tag within the [`collection` object](https://shopify.dev/docs/api/liquid/objects/collection) in an HTML `` tag, with a `class` attribute of `active`, if the tag is currently active. Only applies to collection tags. api_name: liquid source_url: html: https://shopify.dev/docs/api/liquid/filters/highlight_active_tag md: https://shopify.dev/docs/api/liquid/filters/highlight_active_tag.md --- # highlight\_​active\_​tag ```oobleck string | highlight_active_tag ``` returns [string](https://shopify.dev/docs/api/liquid/basics#string) Wraps a given tag within the [`collection` object](https://shopify.dev/docs/api/liquid/objects/collection) in an HTML `` tag, with a `class` attribute of `active`, if the tag is currently active. Only applies to collection tags. ```liquid {% for tag in collection.all_tags %} {{- tag | highlight_active_tag | link_to_tag: tag }} {% endfor %} ``` ##### Code ``` {% for tag in collection.all_tags %} {{- tag | highlight_active_tag | link_to_tag: tag }} {% endfor %} ``` ##### Data ``` { "collection": { "all_tags": [ "extra-potent", "fresh", "healing", "ingredients" ] }, "template": "collection" } ``` ## Output ```html extra-potent fresh healing ingredients ```