link_to_tag
This helper is used to generate an <a> tag with the href attribute that includes the specified tag passed as a parameter. It is used to navigate to the current collection pages, where the resulting page filters and displays products with the specified tag.
Please note that this helper is currently only supported for collection pages and is not compatible with other pages.
Params
tag{String}Product type, requiredhash.text{String}text is used to generate theatag display content text, if passed in non-string will be converted to empty string by default[attribute]{Object}attribute of form html, optional, format: class="_class"returns{String}html
Usage
{{ link_to_tag tag [attribute] }}
Example
{{#each collection.all_tags as |tag|}}
{{#if (contains ../current_tags tag) }}
{{ tag }}
{{else}}
{{ link_to_tag tag class="link-class" title=tag text=tag }}
{{/if}}
{{/each}}
Was this article helpful to you?