setting-schema json配置
{%- if section.settings.show_search_title -%}
<h1>{{ 'general.search.title' | t }}</h1>
{%- endif -%}
{% schema %}
{
"name": "Search page",
"class": "cc-main-search",
"blocks": [
{
"type": "email",
"name": "Email",
"limit": 1,
"settings": [
{
"type": "paragraph",
"content": "REQUIRED - Contact form will not work if this block is removed."
},
{
"type": "checkbox",
"id": "required",
"label": "Required",
"default": true
},
]
},
],
"settings": [
{
"type": "header",
"content": "Heading"
},
{
"type": "range",
"id": "max_filter_options",
"label": "Visible options per filter",
"info": "Remaining options will be automatically collapsed.",
"min": 2,
"max": 50,
"step": 1,
"default": 7
},
{
"type": "checkbox",
"id": "show_search_title",
"label": "Show the default search title",
"info": "",
"default": true
}
],
"presets": [
{
"name": "Contact form",
"blocks": [
{
"type": "email",
"settings": {
"half_width": true
}
},
]
}
],
"default": {
"blocks": [
{
"type": "email"
}
]
}
}
{% endschema %}
属性 | 描述 |
name | 定义section名称 |
class | 额外的class名 |
tag | 渲染section时的tag |
settings | 同setting_schema |
blocks | 在sections中任意添加、排序、删除的一个内容 |
max_blocks | blocks的最大数量 |
presets | 预置即将自己包含在 content_for_index 对象中,添加进主题主页 |
default | 默认配置 |
- settings中属性配置
属性 | 必填 | 说明 | 属性值 |
type | 是 | 输入类型 | 常用:text,textare,radio,checkbox,select,image_picker(上传图片),range(滑块范围) 特殊:color,font_picker,collection(可用产品系列),product(可用产品),blog(博客列表),link_list(菜单列表),page(特定页面),url(内部或外部),video_url(可用代码段),richtext,html,article(可用文章) |
id | 是 | 主题中引用,唯一值 | |
label | 是 | 用途描述 | |
placeholder | 否 | 占位符 | |
options | 否 | 下拉选择,这仅适用于type为select的时候。 [{ “value”: “1”, “label”: “一” },{ “value”: “2”, “label”: “二” }] | |
default | 否 | 默认值 | |
info | 否 | 详细信息 |