Custom Section invalid JSON 'schema' and not selectable in template

The below code is for a custom section I am working on.

I will do a lot more customization to the content area but for now, this is giving me an error. Please let me know what I need to fix to make this work.

  • Error: Invalid JSON in tag ‘schema’

2nd issue I have is I cannot select this section from the customizer on my product pages. I can only add it to the template via code. What am I missing to make this a user-selectable section?


  ### {{ section.settings.content }}

   
{% schema %}
{
  "name": "Collapsible Tab",
  "tag": "product",
  "class": "section",
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "heading",
      "default": "Tab label"
    },
    {
      "type": "textarea",
      "id": "content",
      "label": "Content",
      "default": "Welcome to my Shop"
    },
  ],
  "presets": [
    {
      "category": "Product",
      "name": "Collapsible Tab",
      "settings": {}
    }
  ]
}
{% endschema %}
1 Like

Hi @DavidCab ,

You have commas like this picture:

If you feel like my answer is helpful, please mark it as a SOLUTION. Let me know if you have any further questions.

Best regards.

@DavidCab

oh sorry for that issue you have put wrong code try this code


  ### {{ section.settings.content }}

   
{% schema %}
{
  "name": "Collapsible Tab",
  "tag": "product",
  "class": "section",
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "heading",
      "default": "Tab label"
    },
    {
      "type": "textarea",
      "id": "content",
      "label": "Content",
      "default": "Welcome to my Shop"
    }
  ],
  "presets": [
    {
      "category": "Product",
      "name": "Collapsible Tab",
      "settings": {}
    }
  ]
}
{% endschema %}