Get Data of Metafield Object from slug

Topic summary

A developer is attempting to dynamically retrieve and display metaobject data on a custom Shopify page (URL: /pages/salt/salt-x) using Liquid code but is encountering difficulties.

Current Issue:

  • The user has created a metaobject in Shopify (visible in screenshots) but cannot successfully output its data on the page.
  • They’ve attempted using shop.metaobjects[request.path] to access product data and iterate through it, but the implementation isn’t working.

Guidance Provided:

  • A responder explained how to assign theme templates to metaobjects through the CMS admin and theme customizer.
  • Two approaches were suggested: using the theme customizer to connect sections to metafields, or creating custom sections with direct HTML/CSS/Liquid editing.
  • Screenshots demonstrate the metaobject admin interface and template creation workflow.

Outstanding Questions:

  • The exact relationship between the “salt x” metaobject and products needs clarification.
  • What specific data structure is being looped through (products vs. metaobjects)?
  • The use case and desired layout remain unclear.

The discussion is ongoing, awaiting more specific details about the data structure and intended implementation.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Once you’ve created a metaobject like in your screenshots.

You can view it in the CMS admin:

If there is no ‘Theme template’ assigned to the MetaObject item, there will a button to create one on that screenshot above. It will take you to the theme customizer and ask to create a template.

You can add sections, connect them to specific metafields, and save it to save the template file for all MetaObject template.

You can open that file in theme edit and access see how the section exists in the theme template:

If you want to edit Liquid/HTML/CSS more directly (I’m assuming you want some kind of custom layout on this page?) then one approach is to create yourself a custom section that can be inserted within the customizer and linked up to the metafields via customizer or through the template json.

Be good to know what kind of layout or use-case you are going for here and why that has lead you the need for a custom MetaObject.