Access metaobject child assigned to metafield

Topic summary

Issue: Images from a Shopify metaobject couldn’t be rendered when the product metafield (custom.productcare) stores a list of metaobject entries. Text output worked via metafield_tag, but image attempts (e.g., img_tag) showed a placeholder or “Liquid error: invalid url input.”

Cause: The product metafield is a list of metaobjects, so accessing a single field directly fails. Each referenced metaobject and its fields must be accessed via .value and iterated.

Key details: Metaobject definition “ProductCare” has fields product_care_img (File) and product_care_description (Single line text). Screenshots confirmed the metafield type is a list, which is central to the fix.

Solution: Loop through the list and render each image with image_url and image_tag, e.g.: for productcare in product.metafields.custom.productcare.value → productcare.product_care_img.value | image_url: width: 100 | image_tag. Optionally guard with an if to ensure product_care_img has a value.

Outcome: The loop-based approach worked; the thread is resolved with a confirmed solution.

Summarized with AI on December 28. AI used: gpt-5.

Sure, please find the definition following: