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

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 red : Red is the color of power, passion, and violence.

Thank you for your help :wink:

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!

1 Like

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

1 Like

Hi @LucasMondon ,

Yes, it is entirely possible.

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