0
votes

When creating Collections in Shopify I can easily add Tags to them, which are then displayed on the Collections pages (in most of the themes I've used so far). The Collections page will typically show all the Tags for any Product within that Collection.

If you click the Tag it will go to a new page. I'm trying to find a way to edit those pages - it does not appear that this ability is built into Shopify, so I'm looking for the best solution.

There are easily over a hundred tags on this site too. My hope is to avoid writing a ton of conditional statements, but I fear that may be my only option.

Liquid - Example of what I'm thinking:

{% if current_tags == 'tag-name' %}
  unique content for that tag
{% endif %}

Can anyone point me in a better direction?

1
Can you provide an example on what you require? unique content for that tag , what is it going to be?HymnZzy
An example would be 400 characters of text - at this point that could be lorem ipsum text.jhawes
If not the conditional statements, you could make use of metafields in shopify. More details - help.shopify.com/api/reference/metafield and help.shopify.com/themes/liquid/objects/metafield . Though missing from the documentation, you can add metafields at shop level as well.HymnZzy

1 Answers

1
votes

The solution was simpler than I thought. I was using == when I should have been using 'contains'. Not that if your tags use spaces then you should type them exactly the same vs adding dashes to fill spaces.

Example:

{% if current_tags contains 'My Tag' %}
  <!-- Custom HTML goes here -->
{% endif %}