Shopify themes, liquid, logos, and UX
Hi - I'm in need of help with this simple liqued code.
I want to add an image (GOTS logo) on some of my products (not all are GOTS certified).
I have tagged the product with; show-gots-logo
Then, in the main-product.liquid I have inserted this code under the collapsible content section of my product sidebar.
{% if product.tags contains 'show-gots-logo' %} <div class=\"gots-logo\"> <img src=\"https://cdn.shopify.com/s/files/1/0234/8013/files/show_gots_product.png?v=1746605466\" alt=\"GOTS Certified\"> </div> {% else %} <p>Tag not found</p> {% endif %}
I have tested the img link and it is fine. The code shows up on my product, so it almost works, but how do i get to display the img ? (Only testing on a single product).
Hope someone can help me 🙂
Thanks
Marlene
Hi Marlene 👋
Try this corrected code:
{% if product.tags contains 'show-gots-logo' %}
<div class="gots-logo">
<img src="https://cdn.shopify.com/s/files/1/0234/8013/files/show_gots_product.png?v=1746605466" alt="GOTS Certified" />
</div>
{% endif %}
This will display the GOTS logo only for products tagged with show-gots-logo. No need for backslashes inside HTML tags in Liquid files.
Thank you SO MUCH! Now it works! 😀
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025