Can I create a new setting type for theme architecture?

Solved

Can I create a new setting type for theme architecture?

aliepenter
Shopify Partner
8 0 0

Hi everybody. I have a question about setting architecture of themes, you can see it in https://shopify.dev/themes/architecture/settings/input-settings , i want to know that can i customize a new setting type for it

Accepted Solution (1)

made4Uo
Shopify Partner
3873 718 1221

This is an accepted solution.

Hi @aliepenter,

 

You cannot customize those input-settings. However, you can use it in the section or blocks and can create your own type. See example below. See the difference on the way of calling the code in section and in blocks. 

 

Section 

HTML

<div>
<h2>{{section.settings.heading}}</h2>
</div>

SCHEMA

{% schema %}
{
  "name": "Custom Section",
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "Heading",
    }
]
}
{% endschema %}

 

 

Blocks - Creating your own type

HTML

<div>
<h2>{{section.settings.heading}}</h2>
{% for custom_block in section.blocks %}
<a href="{{custom_block.settings.my_link}}" style="color: {{custom_block.settings.color}}"> 
My Link</a>
{% endfor %}
</div>

SCHEMA

{% schema %}
{
  "name": "Custom Section",
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "Heading"
    }
],
"blocks": [
	{
    "type": "my-custom-block",
    "name": "My custom block",
    "settings": [
		{
		"type": "url",
		"id": "my_link",
		"label": "Link"
		},
		{
		"type": "color",
		"id": "color",
		"label": "Color",
		"default": "#000"
		}
		]
	}
]
}
{% endschema %}

 

Hope this helps

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free

View solution in original post

Reply 1 (1)

made4Uo
Shopify Partner
3873 718 1221

This is an accepted solution.

Hi @aliepenter,

 

You cannot customize those input-settings. However, you can use it in the section or blocks and can create your own type. See example below. See the difference on the way of calling the code in section and in blocks. 

 

Section 

HTML

<div>
<h2>{{section.settings.heading}}</h2>
</div>

SCHEMA

{% schema %}
{
  "name": "Custom Section",
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "Heading",
    }
]
}
{% endschema %}

 

 

Blocks - Creating your own type

HTML

<div>
<h2>{{section.settings.heading}}</h2>
{% for custom_block in section.blocks %}
<a href="{{custom_block.settings.my_link}}" style="color: {{custom_block.settings.color}}"> 
My Link</a>
{% endfor %}
</div>

SCHEMA

{% schema %}
{
  "name": "Custom Section",
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "Heading"
    }
],
"blocks": [
	{
    "type": "my-custom-block",
    "name": "My custom block",
    "settings": [
		{
		"type": "url",
		"id": "my_link",
		"label": "Link"
		},
		{
		"type": "color",
		"id": "color",
		"label": "Color",
		"default": "#000"
		}
		]
	}
]
}
{% endschema %}

 

Hope this helps

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free