我一直喜欢使用Shopify开发人员和员工使用YouTube视频学习Liquid,但我遇到了一个相当奇怪的障碍。据我所知,块类型是我确定的任意文本字符串。我正在关注的YouTube视频使用“select”类型在预设部分创建带有标注的多个块。但是,调试器会将此术语拒绝为“无效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"
,你应该没有问题。