Subject: MediaImage Field in Metaobject Not Resolving

Hi Shopify Support,

I’m having an issue where a MediaImage field in a metaobject (company_profile) is not resolving into a usable image URL in Liquid. The field data is correctly stored, and the GID is retrieved, but the file_url filter and other methods do not produce a valid image URL.

Debug Information:

  • Metaobject Data: {“company_name”:“carma”,“description”:“i like milk”,“logo_image”:[“gid://shopify/MediaImage/51122141397313”],“producer_profile”:“gid://shopify/Metaobject/98630730049”}
  • Direct Logo Image URL: //www.oliohub.ca/cdn/shop/files/?5126
  • Transformed Logo Image URL: (blank)

Steps Taken:

  • Verified that the logo_image field is populated with a valid image in the metaobject.
  • Used Liquid filters like file_url and manual GID transformations to attempt to resolve the URL.

Could you help clarify how to properly resolve MediaImage fields in Liquid or confirm if this requires additional setup?

Thank you for your assistance!

Best regards,

file_url is for Files in /content/files.

To resolve images from metaobjects you should use image_url filter (probably in combination with the image_tag filter)

Hi curzey strange thing I tried that route both by itself and in cobination neither works,
on another section of my page used this and it works
{% if producer_profile.logo_photo != blank %}
{{ producer_profile.name }} logo
{% else %}

No logo available.


{% endif %} however this does not work for the page with the photo above and im pretty confused, a side question these features work fine with metafields i have a much harder time resolving displaying info through metaobjects is there some sort of way to do api with metafields? i only switched cause theres no sope to read and write for metafields on api

in fact heres the whole situation becasue i dont really understand why it wont work and render and a second weird thing is whenever my liquid fetches and renders the text fields in metaobjects it always output “****” around my data that i have to through code remove or clean off but anyway the full situation

Subject: Issue Rendering Pairing Image from Metaobject in Shopify

Message:

Hello Shopify Community,

I am encountering an issue while trying to render pairing images from a metaobject in Shopify. While rendering the producer logo image works perfectly using the same approach, the pairing images are not being rendered correctly, even though the pairing names appear as expected.

Issue Overview:

  • I have set up a metaobject for the pairings, and each pairing contains an image in the pairing_image field, which is a file field.
  • The pairing_image field is populated with the correct image reference (e.g., JPG, JPEG, or PNG files), and the pairing name is rendering correctly.
  • The producer logo image is rendered successfully with the same logic, but the pairing images do not display, even though the URL is correctly generated and passed into the image_url filter.

What Works:

  • The producer profile image is being rendered using the following code:

liquid

Copy code

{% if producer_profile.logo_photo != blank %}
  <img src="{{ producer_profile.logo_photo | image_url: width: 300 }}" alt="{{ producer_profile.name }} logo">
{% else %}
  <p>No logo available.</p>
{% endif %}
  • The image_url filter works perfectly for the producer logo image, and it displays the image correctly.

What Doesn’t Work:

  • The pairing images (stored in the pairing_image field of a metaobject) are not rendered despite following a similar approach.
  • The pairing names render correctly, but the image associated with the pairing refuses to display, even though it’s correctly referenced in the metaobject.

Debugging Result:

  • The pairing image field outputs the correct media reference:

json

Copy code

["gid://shopify/MediaImage/51144825307457"]
  • Shopify correctly retrieves this reference but refuses to display the image.
  • The URL renders the pairing name correctly, but not the image.

What I’ve Tried:

  1. I’ve ensured the images are uploaded as media objects (JPG, JPEG, PNG).
  2. I’ve used the image_url filter for the pairing image just like the logo image.
  3. I’ve confirmed that the pairing image is correctly referenced in the metaobject, but Shopify won’t render the image, even though the image URL is available.

What I Need Help With:

Why does Shopify refuse to render the image for pairings, even though the reference and the process are similar to the producer logo rendering?