How to fix Invalid JSON in tag 'schema' for a form builder

Solved

How to fix Invalid JSON in tag 'schema' for a form builder

HIEa
Excursionist
50 1 8

I am trying to add in this code, but its coming up with the above error message. Can someone please help me correct it?

 

<div class="globo-formbuilder" data-id={{section.settings.form_id}} ></div>
{% schema %}
  {
    "name": "Form",
    "settings": [
        {
          "type": "select",
          "id": "form_id",
          "label": "Select form to display",
          "default": "21114",
          "options": [{"label":"Wholesale Registration form","value":"21114"}]
        }
    ],
    "presets": [
        {
          "name": {
            "en": "Form"
          },
          "category": {
            "en": "Powerful Contact Form Builder"
          }
        }
      ]
  }
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}
 
Accepted Solution (1)

Made4uo-Ribe
Shopify Partner
10038 2387 3014

This is an accepted solution.

Hi @HIEa 

 

I think the name with localization was depreciated already. I remember this to be available in debut theme but anyway. Please see corrected code. This should work

 

 

<div class="globo-formbuilder" data-id="{{section.settings.form_id}}"></div>
{% schema %}
{
  "name": "Form",
  "settings": [
      {
        "type": "select",
        "id": "form_id",
        "label": "Select form to display",
        "default": "21114",
        "options": [{"label":"Wholesale Registration form","value":"21114"}]
      }
  ],
  "presets": [
      {
        "name":"Form",
        "category": {
          "en": "Powerful Contact Form Builder"
        }
      }
    ]
}
{% endschema %}

 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.

View solution in original post

Replies 3 (3)

Made4uo-Ribe
Shopify Partner
10038 2387 3014

This is an accepted solution.

Hi @HIEa 

 

I think the name with localization was depreciated already. I remember this to be available in debut theme but anyway. Please see corrected code. This should work

 

 

<div class="globo-formbuilder" data-id="{{section.settings.form_id}}"></div>
{% schema %}
{
  "name": "Form",
  "settings": [
      {
        "type": "select",
        "id": "form_id",
        "label": "Select form to display",
        "default": "21114",
        "options": [{"label":"Wholesale Registration form","value":"21114"}]
      }
  ],
  "presets": [
      {
        "name":"Form",
        "category": {
          "en": "Powerful Contact Form Builder"
        }
      }
    ]
}
{% endschema %}

 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
HIEa
Excursionist
50 1 8

Thank you so much, this worked!

Made4uo-Ribe
Shopify Partner
10038 2387 3014

Your welcome. Glad to help

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.