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!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024