What's your biggest current challenge? Have your say in Community Polls along the right column.

How to use a specific tag link in new V2.0 liquid?

How to use a specific tag link in new V2.0 liquid?

medlingtonQPS
Shopify Partner
28 0 9

Hi,

Im trying to recreate the filter by tag functionality thats been removed in the new V2.0 SHopify.

Can anyone tell me how Id select a specific tag in liquid and use its link?

e.g. within a loop to go through all the tags:

{% for tag in collection.tags %}

I can use this liquid code to echo the link to filter by that tag:

{ tag | link_to_add_tag: tag }}

Now say I wasnt in a loop and I want to echo the link for a specific tag, how would I do that? Something like this:

{ tag='specific_tag' | link_to_add_tag: tag }

 

Reply 1 (1)

canvasofgod
Shopify Partner
2 0 0

I'm not sure if you're still looking for a solution, but here is how you accomplish this outside a for loop:

 

{{ "custom_link_label" | link_to_add_tag: "specific_tag" }}