Shopify入门

 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_blocksblocks的最大数量
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详细信息

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值