Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I've seen numerous posts here with solutions that provide a code snippet that suppose to work but no one says where you should put it. In my case I've created multiple metfields with the option to upload a file (image), I use it in my product pages section to display certain images, but I have multiple sections and if I do not add images to each metafield then it is displayed without an image. I just want to know where should I put this code:
{% if product.metafields.custom.product_page_image_banner_10 != blank %} {{ product.metafields.custom.product_page_image_banner_10 }}, {% endif %}
Hello @Markas_Suika ,
If you are looking to add it inside the theme files then it all depends on the requirement and the theme you are using.
And if you are trying to add it with dynamic source then I suggest use custom liquid block.
And I think your code should be
{% if product.metafields.custom.product_page_image_banner_10.value %}
// you code goes here
{% endif %}
Thanks
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn 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, 2025