【发布时间】:2021-01-29 09:32:16
【问题描述】:
我试图在 Shopify 部分中创建一个块,一个带有文本的可链接图像 - 它们应该成为我页面的一个新部分,并具有 3 个功能:添加图像、图像链接、标题和描述。它也可以有 2 列。但是,此脚本无法保存。这是它的
{% for block in section.blocks %}
<div class="img" id="call-to-action">
<h1> {{ block.settings.text-box-title }} </h1>
<h3> {{ block.settings.text-box-content }} </h3>
<a href="{{ image-settings.link }}" class="img img--cta">{{ image.settings.link }}</a>
</div>
{% endfor %}
{% schema %}
{
"name": "CTA Blocks",
"max_blocks": 3,
"settings": [
{
"id": "text-box",
"type": "text",
"label": "Heading",
"default": "Title"
}
],
"blocks": [
{
"name": "Add Image with Text",
"settings": [
{
"id": "image",
"type": "image_picker",
"label": "Image"
},
{
"id": "link",
"type": "url",
"label": "Image link"
},
{
"name": "Text Box",
"settings": [
{
"id": "text-box-title",
"type": "text",
"label": "Heading",
"default": "Title"
},
{
"id": "text-box-content",
"type": "richtext",
"label": "Add custom text below",
"default": "<p>Add your text here</p>"
}
]
}
],
"presets": [
{
"name": "Call to Action Blocks",
"category": "CTA button",
"blocks": [
{
"type": "select"
},
{
"type": "select"
}
]
}
]
}
{% endschema %}
{% stylesheet %}
{% endstylesheet %}
{% javascript %}
{% endjavascript %}
你能帮帮我吗?谢谢。
【问题讨论】:
标签: image text shopify block sections