Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a section not working in Shopify Theme development

Tags:

themes

shopify

I have made a few websites before using a shopify theme and I am trying my best to develop my own theme. I understand how sections work, and I can add the sections that I have created in statically, but I cannot dynamically from the theme customizer. Has this happened to anyone before or know of a way to fix it? Instead of being able to choose a section after clicking add a section I just get the message

"This theme doesn't include sections that can be added to the homepage."

The first two screen shots are of my theme customizer, the third is of another theme and what it is supposed to look like. I was under the impression that all you had to do was use the conent for layout tag to add in your sections.

{{ content_for_layout }}

enter image description here

enter image description here

enter image description here

like image 350
SleBluue Avatar asked Jan 16 '17 23:01

SleBluue


People also ask

How do I add sections to a Shopify theme?

In the theme editor, adding a section is as easy as clicking Add section and choosing from the list of available sections. New sections start at the bottom of the page for you to move as needed. Blocks are added in just the same way as sections. Find the section to which you want to add a block and click Add block.

How do I create a section block in Shopify?

Add a blockFrom your Shopify admin, go to Online Store > Themes. Find the theme that you want to edit, and then click Customize.

How do I add a section custom in HTML Shopify?

In your Shopify admin, go to Online Store > Themes. On the Edit HTML/CSS page, locate the Layout section. In the Add Section dialog box, select Custom content from the types of sections list. Then, click Add.


1 Answers

Figured it out! Every section has to have a preset in the {% schema %} otherwise it will not show up in the add a section area.

You put {{ content_for_index }} in the index.liquid file and your preset in the {% schema %} of yoursection.liquid

https://help.shopify.com/themes/development/theme-editor/sections

"presets": [
{
"name": "Collection Carousel",
"category": "Carousel",
"settings": { 

}
}
]

Will make it appear like this:

enter image description here

like image 78
SleBluue Avatar answered Oct 11 '22 01:10

SleBluue