Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Display image as a size chart in Collapsible Row using metafields - Dawn Theme

Solved

Display image as a size chart in Collapsible Row using metafields - Dawn Theme

Melinda5
Explorer
53 3 11

Hello All! 

 

I am getting an error message when it comes to implementing this community thread. I have done steps 1-3 successfully, but when it comes to connecting the size chart to the collapsible row via this content: product.metafields.my_fields.size_guide | img_url }}" alt="Top Notes" width="530">

 

It just appears as the text.

Screenshot 2023-09-19 at 12.17.38 AM.png

I have also tried other codes from other threads and instead they give me an error message like this:

IMG_0162.png

 

Hope someone can help! @LitCommerce 

Thanks so much guys!!

 

Accepted Solution (1)

Melinda5
Explorer
53 3 11

This is an accepted solution.

figured out the problemm...
1. the code stated "my_fields" while my metafield was actually product.metafields.custom.size_guide"

2. once changed, it stated that there was no image. found out I had to add "<img src="{{" to the beginning of the code. This was the final code used:
<img src="{{ product.metafields.custom.size_guide | img_url: 'master' }}" alt="Top Notes"width="530">

PROBLEM SOLVED FINALLY!!!

View solution in original post

Replies 5 (5)

Guleria
Shopify Partner
3661 736 1026

Hello @Melinda5 ,

 

Using this widget liquid code will not wok and output same always.
Try to use custom liquid widget.

custom-liquid-for-image-metafield

 

Thanks

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com
- Try GEMPAGES a great page builder
- If you want to help me please PAYPAL

David_SHT
Globetrotter
605 125 126

Hi @Melinda5 ,

 

This is David at SalesHunterThemes.

you can use block custom liquid in section product information to make it: 

David_SHT_2-1695099688472.png

 

 

This code liquid: 

 

<img src="{{ product.metafields.custom.size_chart | img_url: 'master' }}" alt="Top Notes" width="530">

 

 

Note for you. i am using

 

product.metafields.custom.size_chart

 

you can change it with your key, exam: 

David_SHT_1-1695099614022.png

 

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

David | SalesHunterThemes team

We create fast Shopify themes, focusing on exceptional performance and seamless experience across all devices.

Try our Electro theme Free! (Now at Black Friday price)

Melinda5
Explorer
53 3 11

Hi @David_SHT and @Guleria I was actually hoping to not always display the size chart which is why I wanted it to be collapsible so my customers can click to see only if they need it. The solutions you provided make the size chart always show. Do you know of any way to make this happen? I seen other threads showing it is possible. Thanks so much for the insight and help with this!

Melinda5
Explorer
53 3 11

This is an accepted solution.

figured out the problemm...
1. the code stated "my_fields" while my metafield was actually product.metafields.custom.size_guide"

2. once changed, it stated that there was no image. found out I had to add "<img src="{{" to the beginning of the code. This was the final code used:
<img src="{{ product.metafields.custom.size_guide | img_url: 'master' }}" alt="Top Notes"width="530">

PROBLEM SOLVED FINALLY!!!

Julia777
Excursionist
16 0 11

Hey! This worked for me before but now Dawn had an update and it wont accept the code anymore. Any ideas that are up to date in 2024?