【发布时间】:2021-11-06 10:54:08
【问题描述】:
我一直在尝试为动态部分创建架构,并为某些页面使用一些预定义的默认 URL,但 Liquid 无法接受。这是架构代码:
{% schema %}
{
"name": "My New Section",
"class": "homepage-section",
"tag": "section",
"settings": [
{
"type": "text",
"id": "section-heading",
"label": "Section Heading",
"default": "Default Heading",
"info": "Meaningful copy in 25 characters or less."
},
{
"type": "url",
"id": "link-1",
"label": "Link URL 1",
"default": "/collections/mycollection"
}
],
"presets": [
{
"name": "My New Section",
"category": "My Sections"
}
]
}
{% endschema %}
因此,对于“type”:“url”,我尝试定义默认集合“default”:“collections/mycollection”,这是我尝试保存文件时的错误消息:
此文件包含以下错误:错误:无效架构: id="link" 默认设置必须是字符串或数据源访问 路径
我尝试了一些不同的选项但没有成功:
“默认”:“https://testing.myshopify.com/”
“默认”:“https://testing.myshopify.com/”
“默认”:“收藏/我的收藏”
“默认”:“收藏/我的收藏”
请告诉我是否有办法处理它。
【问题讨论】: