Skip to main content

link_to_type

string | link_to_type
returns string

Generates an HTML <a> tag with an href attribute linking to a collection page that lists all products of the given product type.

{{ 'Health' | link_to_type }}

Output

<a href="/collections/types?q=Health" title="Health">Health</a>
string | link_to_type: attribute: string

You can specify HTML attributes by including a parameter that matches the attribute name, and the desired value.

{{ 'Health' | link_to_type: class: 'link-class' }}

Output

<a class="link-class" href="/collections/types?q=Health" title="Health">Health</a>
Was this page helpful?