Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am customizing my theme and taking advantage of the new Metaobject definitions.
I've created a Metaobject for a landing page template. I will create different landing page data entries for different landing pages that I want. Then I'm creating a Template for the Landing page metaobject. My metaobject has things like H1 Title, Button label, Button link, featured collection, marketing copy, etc.
One of the sections I want to include is FAQs, but not all of the same FAQs will appear on each landing page. So I've created a field referencing another Metaobject called "FAQs" (handle is `faqs`). This way I can select any number of relevant FAQs in each Landing Page data entries in my custom Metaobject.
Now when developing a Section in my page to show these FAQs, I wanted to have a setting, that would allow me to bind the contents of the section to the Landing Page metaobject that has my selected FAQs. So I believe I want to have a setting of type "metaobject_list". When I add this setting, my VS Code theme validator tells me I must have the property "metaobject_type"
I searched for a very long time to figure out what value should go into this `metaobject_type` property in my settings definition, but I believe it to be the Metaobject type handle. In this case, that should be `faqs` but the console keeps telling me it's Invalid Schema.
Here is my code setup:
ERROR: Invalid schema: setting with id="faq_metaobject_list" type is invalid
{ "type": "metaobject_list", "id": "faq_metaobject_list", "label": "Metaobject", "metaobject_type": "faqs" }
No matter what I put in here, it does not like it.
Am I approaching this correctly? Is `metaobject_list` the right "type" here? If so, what should be the value for "metaobject_type"?
Thanks @Hesmerci
I have scoured the internet and the documentation, but I have not found ANY examples of this code. Even ChatGPT isn't so useful. I think the metaobject features are so new that there is not a lot of content or examples out there yet. On your response....
To be clear here are some more specifics:
In fact, using Google to search the contents of shopify.dev yields that the exact phrase `metaobject_type` does not appear at on Shopify.dev at all
You know what - I think I have come to determine that the intellisense in VScode is several steps ahead of the actual CLI, theme validator and APIs.
I found this "type" : "metaobject_list" from VScode intellisense, but it links to a page in the theme docs that has no mention of these types.
https://shopify.dev/docs/storefronts/themes/architecture/settings/input-settings#metaobject_list
You can see in the list of specialized input settings that `metaobject` and `metaobject_list` are not shown anywhere.
@theevilgenius There is no `metaobject` or `metaobject_list` input type. The VScode Liquid intellisense extension led me astray and down this rabbit hole. So you cannot take this approach (right now). I assume that this is a planned addition in the future but not available today. I have an issue open with Shopify here.
What I did instead that works but is less ideal, is to manually associate my object records. So I had a metaobject for "faqs" and then in my other metaobject for "landing_pages" I just have a metaobject type on landing_pages that references "faqs" and then in each record I add, I manually select the FAQs that are associated with that landing page.
It is not preferred for me, but it works. Ideally, I'd like to have new FAQs automatically associate with other new landing_page records because they match on a tag or category or something other than an explicit mapping between the two objects.
Hope it helps!
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025