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.
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024