【发布时间】:2017-10-31 19:02:17
【问题描述】:
我正在尝试向 Shopify 主题添加带有块的常见问题解答部分。我可以动态添加没有块的部分,但是一旦我尝试添加块,我就会不断收到错误消息
“一个错误导致 faq.liquid 无法保存。”
我不确定到底是什么问题或为什么它不起作用,因为这是一个非常模糊的错误消息。
这是我的代码:
<hr>
<div id="section-faq">
<div class="section-header text-center">
<h3> {{ section.settings.text-box }} </h3>
</div>
{% for block in section.blocks %}
<div class="btn" id="faq">
<a href="{{ block.settings.text-box }}" class="btn">{{ block.settings.text
}}</a>
</div>
{% endfor %}
</div>
<hr>
{% schema %}
{
"name": "faq",
"max_blocks": 6,
"settings": [
{
"id": "text-box",
"type": "text",
"label": "Heading",
"default": "FAQ"
}
],
"blocks": [
{
"type": "QA",
"name": "QA",
"settings": [
{
"id": "text-box",
"type": "text",
"label": "Question",
"default": "Add Question"
},
{
"id": "text",
"type": "richtext",
"label": "Answer",
"default": "<p>Add your answer here</p>"
}
]
}
],
"presets": [
{
"name": "FAQ",
"category": "Faq"
}
]
}
{% endschema %}
【问题讨论】:
标签: json error-handling shopify liquid