if template is product or any product based template

Highlighted
Shopify Partner
43 0 0

For my meta descriptions i am using {% when 'product' %} to identify the product template. But I have other versions of this template, say {% when 'product.fuji' %} and so I have to add a new line in the liquid to accommodate each template.

I was wondering if there is a way to write the liquid to reference all "product" based templates?

like {% when 'product.*' %} for example.

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
489 0 42

Hey Beezer!

You could do {% if template == "product" %} 

www.tetchi.ca | www.twitter.com/t3tchi
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
489 0 42

or if you have alternate product templates, you should be able to do:

{% if template contains 'product' %}

www.tetchi.ca | www.twitter.com/t3tchi
Highlighted

Does not seem to work if we place this code in a "styles.css.liquid" file. Any idea why ?

C'est simple comme bonjour ! Ou presque.
Need some help to customize your website? Message me anytime: 5euros.com/profil/maxdesign
0 Likes
Highlighted
Shopify Partner
8 0 18

That is liquid code, not css. It needs to be used in a construction file, like theme.liquid

0 Likes