Solved

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

HIEa
Excursionist
22 1 4

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
5991 1443 1782

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 %}

 

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
For FREE, premium codes, and trusted, knowledgeable Shopify developers, visit us at

Made4uo.com


View solution in original post

Replies 3 (3)

Made4uo-Ribe
Shopify Partner
5991 1443 1782

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 %}

 

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
For FREE, premium codes, and trusted, knowledgeable Shopify developers, visit us at

Made4uo.com


HIEa
Excursionist
22 1 4

Thank you so much, this worked!

Made4uo-Ribe
Shopify Partner
5991 1443 1782

Your welcome. Glad to help

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
For FREE, premium codes, and trusted, knowledgeable Shopify developers, visit us at

Made4uo.com