定制的部分没有出现在Shopify的新主题编辑器中

Naa*_*afu 5 themes liquid shopify sections

随着新主题编辑器的发布,我被指派使用Shopify的新主题构建器框架构建一个新客户的网站.

一切都很顺利,除了当我在后端创建一个新的"部分"时,它无法出现在主题编辑器的"部分"区域内.

知道这里出了什么问题吗?是否有另一个JSON文件与我缺少的部分相关联?

<div id="callToActions">
  <div class="grid grid--no-gutters">
    <div class=""></div>
  </div>
</div>



{% schema %}
{
  "name": "Call to Actions",
  "class": "index-section index-section--flush",
  "settings": [
    {
      "id": "cta_1_title",
      "type": "text",
        "label": "CTA 1 Title",
      "default": "Dryups Specials"
    }
  ]
}
{% endschema %}
Run Code Online (Sandbox Code Playgroud)

Car*_*son 13

你快到了,只缺少一件事.如果已定义预设,则部分将仅显示为要添加的选项.

此更新将显示:

{% schema %}
{
  "name": "Call to Actions",
  "class": "index-section index-section--flush",
  "settings": [
    {
      "id": "cta_1_title",
      "type": "text",
      "label": "CTA 1 Title",
      "default": "Dryups Specials"
    }
  ],
  "presets": [{
    "name": "Call to Actions",
    "category": "Text"
  }]
}
{% endschema %}
Run Code Online (Sandbox Code Playgroud)

注意类别.如果省略,它将最终在杂项下.

  • 我希望 Shopify 文档对此有说明。比如警告或容易注意到的东西。过去几周一直在开发一个主题,我不敢相信他们的文档中经常缺少这种重要的注释。 (9认同)
  • 到 2021 年仍然相关(使用 OS 2.0),除了章节架构文章的预设部分之外,仍然没有在任何地方提及它。好像我们应该从大学或祖先那里知道这一点 (4认同)