I’m using the dawn theme and I want to add an image section in the product template which can show the image from metafields on the product page.
However, In the editor, product template, I can’t find the “Image” section. Can someone help me?
- Create a new section called “custom-image-section.liquid”.
- In the newly created section file, add the following code:
{% if product.metafields.custom_fields.image %}
{% endif %}
- Save the section file.
Now, you need to include this custom image section in your product template:
- In the left sidebar, under “Sections”, locate the “product-template.liquid” file and click on it.
- Find the appropriate location in the product template where you want to display the image section.
- Add the following code at that location:
{% section 'custom-image-section' %}
