在Shopify主题的{%schema%}部分添加动态内容
根据Shopify主题教程 文件,我们可以通过set{%schema%}部分定义主题设置,如以下示例所示:在Shopify主题的{%schema%}部分添加动态内容,shopify,liquid,shopify-template,Shopify,Liquid,Shopify Template,根据Shopify主题教程 文件,我们可以通过set{%schema%}部分定义主题设置,如以下示例所示: {% schema %} { "name": "Line", "class": "index-section", "settings": [ { "type": "radio", "id": "small_line", "label": "Correct Gap", "options": [ {
{% schema %}
{
"name": "Line",
"class": "index-section",
"settings": [
{
"type": "radio",
"id": "small_line",
"label": "Correct Gap",
"options": [
{
"value": "none",
"label": "None"
},
{
"value": "gap1",
"label": "Different Gap"
}
],
"default": "none"
}
],
"presets": [
{
"name": "Line",
"category": "Design",
"settings": {
}
}
]
}
{% endschema %}
我的问题是,是否有一种方法可以在模式部分将此设置设置为动态的,比如在上面的示例中将“small_line”选项定义为变量,类似于下面的内容
{% schema %}
{
"name": "Line",
"class": "index-section",
"settings": [
{
"type": "radio",
"id": "small_line",
"label": "Correct Gap",
"options": MY_OPTIONS_VAR,
"default": "none"
}
],
"presets": [
{
"name": "Line",
"category": "Design",
"settings": {
}
}
]
}
{% endschema %}
不,您不能在模式对象中添加任何液态代码 那里的一切都需要作为静态信息输入