Hello all, I’m a bit stuck and surprised this is so challenging.
The goal is to save settings in the admin area, and load them for use in the theme editor app block settings schema via metafields.
1: In the admin area I’m creating a valid json object and saving it as a meta object of type json:
"namespace": "mynamespace",
"key": "droplist",
"ownerId": shopObject.id,
"type": "json",
"value": JSON.stringify(droplist_data)
-works fine. data saved.
2: In the liquid area of the app block I’m retrieving it and confirming it’s a json object:
{% assign optionslist = shop.metafields.mynamespace.droplist | json | default: '[]' %}
-works fine, outputs formatted data .
3: In the schema of the app block I’m trying to insert it as the options array. (this is how the Dev Assistant says it should work) but I’m having no success.
{
"type": "select",
"id": "locations",
"label": "t:blocks.locations.settings.set_loc.label",
"options": {{ optionslist }},
"default": "US"
},
Error:
Invalid tag 'schema': Unable to parse 'schema' content
I’ve tried a number of things but always get the "Unable to parse 'schema' content"
error.
What’s the proper method for doing this?
How would I dynamically create multiple droplists?
Perhaps this an issue with the schema validator? Can that be overridden to test?
Thanks in advance, Ski_Bot