Help! Metaobject list of files show up as "no image" using Custom Liquid

Topic summary

Issue: Images from a metaobject “list of files” field render as Shopify’s “no image” placeholder when looped via Custom Liquid.

Context: The metaobject (Influencer) stores a gallery of images. Names render correctly, but images do not. Screenshots show the placeholder output and the metaobject field setup.

Cause: The code treats the gallery as a comma‑separated string and uses split, producing strings instead of file objects. The img_url filter expects a file/media object, not a string.

Fix: Access the metaobject’s file list as an array and iterate it directly.

  • Use influencer.gallery.value to get the array of file references.
  • Loop over that array and apply img_url (e.g., image | img_url: ‘500x’).
  • No split is needed.

Outcome: The corrected approach renders images successfully.

Notes:

  • Metaobject: a custom data type in Shopify; metafields: custom fields on objects.
  • The discussion reached resolution with a working code pattern; no further open questions mentioned.
Summarized with AI on December 26. AI used: gpt-5.

Hi all,

I’m trying to print a list of files (images) through custom liquid code and for some reason, Shopify recognizes what I’m trying to do but only displays the placeholder “no image” instead of the images I added to the metaobject. As seen below:

The reason I’m doing it this way is because I want to be able to select a list of pictures I already uploaded for specific Influencers we partner with and doing it this way makes it easier for my co-workers to select pictures for each influencer, instead of having 9 different metafields inside the metaobject for each picture. I’ve shown my metaobject structure below:

I don’t understand why it is not working as I can access the metaobject information fine (the following code prints the name fine:

{% assign influencers = shop.metaobjects.influencer.values %}

{% for influencer in influencers %}

{{ influencer.name }}

{% endfor %} ) The code I'm using for the printing of the images is:

{% assign influencers = shop.metaobjects.influencer.values %}

{% for influencer in influencers %}

{{ influencer.name }}

{% assign gallery = influencer.gallery | split: ‘,’ %}
{% for image in gallery %}
{% assign image_url = image | img_url: ‘500x’ %}
{{ influencer.name }}
{% endfor %}
{% endfor %}

If anyone has any idea what I’m doing wrong or how I can approach this differently, please help. I have been stuck on this for quite some while and feel like this should be doable. If not, also please tell me.

Thanks for ANY help in advance!

Why add this?

It is supposed to split the influencer.gallery values from a string to an array. If I remove that part, the code doesn’t work anymore.

{% assign influencers = shop.metaobjects.influencer.values %}
{% for influencer in influencers %}
## {{ influencer.name }}

{% assign gallery = influencer.gallery.value %}
{% for image in gallery %}
{% assign image_url = image | img_url: '500x' %}

{% endfor %}
{% endfor %}

Thanks! This seem to work! Can you explain to me what I did wrong?