Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
This doesn't work, the myIcon_url variable corresponds to a placeholder 'no-image' url:
{% assign myIcon_url = 'myIcon.svg' | file_img_url %} {% assign myIcon_tag = '<img src="' | append: myIcon_url | append: '">' %} {{ product.description | replace: '<!-- myIcon here-->', myIcon_tag }}
But this does work:
{% assign myIcon_url = 'myIcon.svg' | file_url %} {% assign myIcon_tag = '<img src="' | append: myIcon_url | append: '">' %} {{ product.description | replace: '<!-- myIcon here-->', myIcon_tag }}
Reading the documentation, I don't see what might be the cause of this discrepency. Is it a bug, or am I missing something?
Hi @stduh
It may be the case that file_img_url doesn't work with SVG, Please try jpg or png if it is the case.
It will help you to debug the issue
Thanks!
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