Hi,
I followed some Solutions offered to similar discussions but they don’t work on my case.
I have created a product metafield image called:
product.metafields.my_fields.top_note_icon
I am trying to display this PNG icon image on the product template. I have tried with these codes, none worked:
<img src="{{ product.metafields.my_fields.top_note_icon.image | asset_url }} alt=“Top Notes” width=“120” height="120>
Anyone that can help?
For metafields of type file_reference in case of images the object returned is a media object and to generate the URL, you need to use Media Filters
This is the correct code to use
1 Like
Hi @drakedev ,
Thanks, however I am getting this liquid error:
— Liquid syntax error: Expected end_of_string but found id in “{{ product.metafields.my_fields.top_note_icon | img_url: 120x120 }}”
The full div is:
#### TOP NOTES
{{ product.metafields.my_fields.top_note_description }}
It seems that the documentation contain an error. This syntax will work
1 Like
I am having a similar issue trying to add a metafield to my product page for a size chart. I created the metafield but it doesn’t display on the theme settings when I’m in the shop. Do you know what the html code is to add a metafield section?
ARY-LO
January 30, 2023, 8:50am
7
Did u find any solution? I’m having the same problem.
Thank you!