Shopify schema help me

2.7k Views Asked by At

I try to create any container to understand how it works, I create a new file (customise_menu.liquid), write schema and copy the settings to the settings_schema.json, but it doesn't work when I go to The main page editor there, schema isn't there. I googled it, but it's useless. What could be the problem?

{% schema %}
  {
    "name": "something",
    "settings": [
      {
        "id": "title",
        "type": "text",
        "label": "Title",
        "default": "Hello world"
      }
    ]
  }
{% endschema %}

Json file

[
  {
    "name": "theme_info",
    "theme_name": "Jumpstart",
    "theme_author": "Shopify",
    "theme_version": "7.2.1",
    "theme_documentation_url": "https:\/\/help.shopify.com\/manual\/using-themes\/sections",
    "theme_support_url": "https:\/\/support.shopify.com\/"
  },
  {
    "name": "something",
    "settings": [
      {
        "id": "title",
        "type": "text",
        "label": "Title",
        "default": "Hello world"
      }
    ]
  },
  {
    "name": {
      "de": "Farben",
      "en": "Colors",
      "es": "Colores",
      "fr": "Couleurs",
      "it": "Colori",
      "ja": "色",
      "pt-BR": "Cores"
    },
    "settings": [
      {
        "type": "header",
        "content": {
          "de": "Allgemein",
          "en": "General",
          "es": "General",
          "fr": "Général",
          "it": "Generale",
          "ja": "一般設定",
          "pt-BR": "Geral"
        }
      },
      {
        "type": "color",
        "id": "color_body_bg",
        "label": {
          "de": "Hintergrund",
          "en": "Background",
          "es": "Fondo",
          "fr": "Arrière-plan",
          "it": "Sfondo",
          "ja": "背景",
          "pt-BR": "Plano de fundo"
        },
        "default": "#ffffff"
      },
.......................

When I tried to change one of the schemes, I just changed the name in line default (I changed "Blog" to "12345"), and it immediately stopped working, from this I can conclude that there is a file where you need to prescribe all the settings, in theory it should be a file settings_schema.json, but it doesn't work.

1

There are 1 best solutions below

0
Alice Girard On

It seeems like there is a confusion between the settings_schema.json file which manages global theme settings and sections specific settings.

This part should be written in customize_menu.liquid:

{% schema %}
  {
    "name": "something",
    "settings": [
      {
        "id": "title",
        "type": "text",
        "label": "Title",
        "default": "Hello world"
      }
    ]
  }
{% endschema %}

It will appear in theme customize interface in the "Section tab", then click on "something" that should be listed.