Solved

How to add dynamic descriptions based on tags in my product collections?

LucasMondon
Excursionist
26 0 6

Hello, I have already a unique collection description for each of my collections (80+) and i would like to also add a few sentences or maybe a paragraph below the main description according to the tag used in the collection url (the tag just sort out my products in this specific collection).

 

So, it would be like this :

 

If my collection is "https://ilikeshoes/collections/sandals"  and the tag in use is red "https://ilikeshoes/collections/sandals?constraint=red"

 

There will be the main description (the one written in the rich text editor) : This collection lists all our sandals, find the ones you like among 50 references.

+ the dynamic description according to the tag redRed is the color of power, passion, and violence.

 

Thank you for your help 😉

 

Accepted Solution (1)

LitExtension
Shopify Partner
4860 1002 1146

This is an accepted solution.

Hi @LucasMondon,

Please go to collection-template.liquid file and add code:

{% if current_tags contains 'red' %}
Red is the color of power, passion, and violence.
{% elsif current_tags contains 'blue' %}
Blue is ....
{% endif %}

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify

View solution in original post

Replies 3 (3)

LitExtension
Shopify Partner
4860 1002 1146

This is an accepted solution.

Hi @LucasMondon,

Please go to collection-template.liquid file and add code:

{% if current_tags contains 'red' %}
Red is the color of power, passion, and violence.
{% elsif current_tags contains 'blue' %}
Blue is ....
{% endif %}

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
LucasMondon
Excursionist
26 0 6

thank you, it works, but do you think I can use the same code for adding meta titles to theses “tagged” collections pages ?

LitExtension
Shopify Partner
4860 1002 1146

Hi @LucasMondon,

Yes, it is entirely possible.

If you have any further questions, you can contact me.
Happy to help you.

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify