Nesting setting + blocks

Highlighted
New Member
12 0 0

Hi there,

I'm trying to mix the section settings + block elements together to create some sort of a manual Instagram feed where the storemanager can past their Instagram username (which will become a link) as a basic section setting and then upload four pictures as block elements.

I was trying something like this but I guess it isn't the right way since it won't work:

{% schema %}
{
  "name": "Manual Instagram feed",
  "settings": [
    {
      "id": "linktext",
      "type": "text",
      "label": "Instagram name"
    }
  ]
  "blocks": [
    {
      "type": "link_list",
      "name": "Footer menu",
      "settings": [
        {
          "id": "title",
          "type": "text",
          "label": "Menu title"
        },
        {
          "id": "footer_linklist",
          "type": "link_list",
          "label": "Footer menu"
        }
      ]
    }
  ]
}
{% endschema %}

 

0 Likes
Shopify Partner
2433 0 436

Hi Chris, 

as you explained this, the scheme should be like this:

{% schema %}
{
  "name": 	"Manual Instagram feed",
  "class": "index-section",
  "max_blocks": 4,
  "settings": [
    {
      "id": "linktext",
      "type": "text",
      "label": "Instagram name"
    }
  ],
  "blocks": [
    {
      "type": "image",
      "name": "Instagram picture",
      "settings": [
        {
        "type": "image_picker",
        "id":	"image",
        "label":	"Image"
        }
      ]
    }
  ],
  "presets": [
    {
  		"category": "image",
  		"name":	"Manual instagram",
  		"settings":
  		  {
  			 "linktext": "https://instagram.com"
        },
  		"blocks":[
  			{
  				"type":"image"
  			}
  		]
    }
  ]
}
{% endschema %}

 

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com! My post solved your problem? This is my Paypal too :)
1 Like
New Member
12 0 0

Awesome! Works like a charm! Thanks you so much :)

0 Likes