"Select" 方块属性无效
"Select" block attribute invalid
我一直很喜欢使用 Shopify 开发人员和员工提供的 YouTube 视频来学习 Liquid,但我 运行 遇到了一个相当奇怪的障碍。据我了解,Block 类型是我确定的任意文本字符串。我关注的 YouTube 视频使用类型“select”在预设部分创建多个带有标注的块。但是,调试器拒绝此术语作为 "invalid ID."
我的架构如下:
{% schema %}
{
"name": "Footer Section",
"max_blocks": 3,
"settings": [
{
"id": "footer-section-title",
"type": "text",
"label": "Footer Title",
"default": "Footer"
}
],
"blocks": [
{
"type": "select",
"name": "select",
"settings:": [
{
"id": "footer-linktext",
"type": "text",
"label": "Link Text",
"default": "Click Here"
},
{
"id": "footer-linkurl",
"type": "url",
"label": "Link URL",
"default": "Click Here"
}
]
}
],
"presets": [
{
"name": "Footer Blocks",
"category": "Footer",
"blocks": [
{
"type": "select"
},
{
"type": "select"
}
]
}
]
}
{% endschema %}
这与 2017 年视频中出现的效果几乎相同。情况有变化吗?我试过其他条款,但都被拒绝了。
提前致谢!
您的 "settings:": [
字符串中还有其他 :
。这就是抛出错误的原因。
将其更改为仅 "settings"
,您应该不会有问题。
我一直很喜欢使用 Shopify 开发人员和员工提供的 YouTube 视频来学习 Liquid,但我 运行 遇到了一个相当奇怪的障碍。据我了解,Block 类型是我确定的任意文本字符串。我关注的 YouTube 视频使用类型“select”在预设部分创建多个带有标注的块。但是,调试器拒绝此术语作为 "invalid ID."
我的架构如下:
{% schema %}
{
"name": "Footer Section",
"max_blocks": 3,
"settings": [
{
"id": "footer-section-title",
"type": "text",
"label": "Footer Title",
"default": "Footer"
}
],
"blocks": [
{
"type": "select",
"name": "select",
"settings:": [
{
"id": "footer-linktext",
"type": "text",
"label": "Link Text",
"default": "Click Here"
},
{
"id": "footer-linkurl",
"type": "url",
"label": "Link URL",
"default": "Click Here"
}
]
}
],
"presets": [
{
"name": "Footer Blocks",
"category": "Footer",
"blocks": [
{
"type": "select"
},
{
"type": "select"
}
]
}
]
}
{% endschema %}
这与 2017 年视频中出现的效果几乎相同。情况有变化吗?我试过其他条款,但都被拒绝了。
提前致谢!
您的 "settings:": [
字符串中还有其他 :
。这就是抛出错误的原因。
将其更改为仅 "settings"
,您应该不会有问题。