"file_img_url" filter returns the 'no-image' placeholder, but just "file_url" can find the image?

"file_img_url" filter returns the 'no-image' placeholder, but just "file_url" can find the image?

stduh
Visitor
1 0 0

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?

Reply 1 (1)

pawankumar
Shopify Partner
618 91 112

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!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan