{% if page.url == "/tag page" %} add custom meta description, Help Please.

Shashisarge
New Member
2 0 0

Hi,

I want to display custom meta description on some tag pages. (e.g. https://caqaresources.com.au/collections/assessment-kit/Assessment-Kit-(Q) ) and I try to use a construction like:

 

 

{% if collection.handle == 'assessment-kit' and collection.tags contains 'Assessment-Kit-(Q)' %}
<meta name="description" content="Test meta description">
{% endif %}

 

 

This is not working Please someone can help me find the right solution? Thank you!

0 Likes
florinanghel
Shopify Partner
102 15 17

That looks like it should work if the collection has that tag/handle combo, but since the handle is checked why check the tag also? Maybe only check if collection exists and then the tag without the handle.

0 Likes
Shashisarge
New Member
2 0 0

can you please, rewrite the code?

0 Likes