Show Image metafield in EComposer

Author: Anna Nguyen 4755 views

Please follow this article to learn what is metafield and how to create it first, then follow the steps below to display the Image from metafield to your page in EComposer:

Step 1: For example, I created a metafield with the “Image (File)” type to be able to upload the image.

image 173 1024x552 1

Step 2: Open your Product in the Shopify admin to add the image to the metafield.

image 174 1024x552 1

Step 3: Open the EComposer page editor to add a Metafield element to your page.

23810

On the Metafield Source, choose Select from list, then scroll down to find and select the metafield you just created:

image 175 1024x553 1

Or choose Custom Liquid in the Metafield Source, and use the code below (replace the orange code with your metafield) for further customization.

This code is for the “One file” metafield type:

{{ product.metafields.custom.image.value  | img_url: '500x' | img_tag }}
image 176 1024x551 1

Please use the code below for the List of files type:

{% assign datas = product.metafields.custom.ecomposer_image.value %}
{% for data in datas %}
{{data | image_url: width: '500x' | image_tag}}
{% endfor %}

Leave a Comment

Enjoy a free 3-day trial. Then get your first month for $1. Try Now.