schema - “选择”块属性无效
问题描述
我一直很享受使用 Shopify 开发人员和员工提供的 YouTube 视频学习 Liquid,但我遇到了一个相当奇怪的问题。据我了解,块类型是我确定的任意文本字符串。我正在关注的 YouTube 视频使用“选择”类型在预设部分创建多个带有标注的块。但是,调试器拒绝将此术语作为“无效 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"
,您应该没有问题。
推荐阅读
- php - 为什么字符串等于 PHP 中的整数 0?
- javascript - 嵌套 module.exports 的解释
- sql - SQL over 子句 - 将分区划分为编号的子分区
- wordpress - wordpress 多站点子目录开放力与 www
- ms-office - 加载功能区后更改功能区菜单属性
- javascript - QPrintDialog 没有正确弹出
- ios - NumberFormatter string(from:NSNumber) 方法有小数位问题
- amazon-web-services - 如何在没有 VPN 或点到站点的情况下将本地计算机连接到在 AWS 或 Azure 中运行的 AD DC
- javafx - 如何使用 javafx 管理多个窗口
- react-native - 如何在 xmpp.js(在 react-native 中)和 MongooseIM(作为聊天服务器)中使用流管理确认?