未在自定义区域中使用shopify image_picker显示图像

问题描述 投票:0回答:1

我已经在shopify主题中创建了一个自定义部分。在{%schema%}标记中,这是我的代码:

{% schema %}
 {
     "name": "about",
     "settings": [
                    {
                        "type": "text",
                        "label": "Heading",
                        "id": "heading"
                    },
                    {
                        "type": "richtext",
                        "label": "description",
                        "id": "description"
                    }

                ],
        "blocks" : [
            {
                "type": "image",
                "name" : "image block",
                "settings" : [
                    {
                        "type": "image_picker",
                        "label": "your image",
                        "id" : "image"
                    }
                ]
            }
        ],
    "presets": [{
    "name": "about",
    "category": "image",
        }]
    }
}
 {% endschema %} 

文本和RTF以及上载图像的选项都可以正常工作,但是图像无法在页面上呈现。它仅显示“找不到典型图像”图标。

这是我尝试显示图像的方式:

{% for block in section.blocks %}
    <img src="{{ block.settings.image | image_url:'master'}}"/>
{%endfor%}

我什至尝试上传“免费图片”。

shopify sections imagepicker
1个回答
0
投票

| image_url过滤器更改为| img_url

© www.soinside.com 2019 - 2024. All rights reserved.