Re: New schema is incompatible with the current setting value. Invalid value for type in block '8929

Solved

New schema is incompatible with the current setting value. Invalid value for type in block '89291d4f

jake_lue
Shopify Partner
38 1 6

Hi guys, I'm new to liquid and I have a problem. What's wrong with my second block as it says that its incompatible. Anyone can explain or give some article links that's valuable and easy to understand? I'll appreciate all the help Thanks 🙂 

 

My first block works fine, but the second one is not working.

jake_lue_0-1626337331023.png

 

Accepted Solution (1)

Amarjyoti
Excursionist
23 10 25

This is an accepted solution.

Hey @jake_lue,

You don't need to define multiple blocks array. Instead, you can use different block types inside one block array.
Please see the below example. You can also refer to this link for more information about section schema. 

{% schema %}
{
  "name": "Schema Demo",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": "Section title"
    }
  ],
  "blocks": [
     {
       "name": "First Block",
       "type": "image",
       "settings": [
         {
           "type": "image_picker",
           "id": "image",
           "label": "Image"
         }
       ]
     },
     {
       "name": "Second Block",
       "type": "text",
       "settings": [
         {
           "type": "text",
           "id": "text",
           "label": "Text"
         }
       ]
     }
   ]
}
{% endschema %}

 

Amarjyoti | I'm here to help and share some insights. Not looking for work.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

View solution in original post

Replies 5 (5)

Amarjyoti
Excursionist
23 10 25

This is an accepted solution.

Hey @jake_lue,

You don't need to define multiple blocks array. Instead, you can use different block types inside one block array.
Please see the below example. You can also refer to this link for more information about section schema. 

{% schema %}
{
  "name": "Schema Demo",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": "Section title"
    }
  ],
  "blocks": [
     {
       "name": "First Block",
       "type": "image",
       "settings": [
         {
           "type": "image_picker",
           "id": "image",
           "label": "Image"
         }
       ]
     },
     {
       "name": "Second Block",
       "type": "text",
       "settings": [
         {
           "type": "text",
           "id": "text",
           "label": "Text"
         }
       ]
     }
   ]
}
{% endschema %}

 

Amarjyoti | I'm here to help and share some insights. Not looking for work.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
jake_lue
Shopify Partner
38 1 6

@Amarjyoti Thank you for helping me sort this out 🙂

Amarjyoti
Excursionist
23 10 25

@jake_lue It's my pleasure. Happy Coding!!

Amarjyoti | I'm here to help and share some insights. Not looking for work.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
jake_lue
Shopify Partner
38 1 6

Do you have something like a discord group for developers that involves liquid? 🙂

Collabrium
Shopify Partner
1 0 0

Once you've created the block in your template [products.json], You need to go into the sections and find [main-product.liquid] file, scroll all the way down to the schema and define it and its settings there too. Hope this helps