Include a metafield product image into collapsible row in product page

Hello, I want to put a metafield product image in this collapsible row but when I try to connect a new dynamic source, it doesn’t allow me to link it here. Is there a way to connect it so that the metafield image is display for all products? (i.e. each product having its own metafield image).

The namespace and key of the metafield is “custom.product_description_image”, any ideas?
I tried putting some code in sections/collapsible-content.liquid but to no avail

Thank you,

URL: jajamoon.com

Hi @nahuel_123

Since the collapsible content is a richtext, it doesn’t allow images, you will not be able to add images. But you can modify the code to dynamically add the image with the richtext

1 Like

Hey @nahuel_123 ,

In the sections/collapsible-content.liquid file, go to the section schema. It starts with {% schema %}. In the schema, locate the ‘row_content’ or something similar field. It will have a type of richtext. It will look similar to the below image. Change the type to ‘liquid’.

Then, from your theme customiser, write the following code in your row content field

{% assign meta_image = product.metafields.custom.product_description_image %}
{% if meta_image != blank %}
  
{% endif %}

You can adjust the height and width as needed. You might also need to add some CSS to style it correctly.

I hope it helps.

:bomb: Always backup themes before modifying files; especially like this.

Making a change to a settings type may loose information, this can potentially completely strip out any rich text setting affecting all templates using that setting or other side effects.

Either way, it didn’t work, so the file is as original.

Still looking for a solution.