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 }}
Run Code Online (Sandbox Code Playgroud)
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": {
}
}
]
Run Code Online (Sandbox Code Playgroud)
Will make it appear like this:
归档时间: |
|
查看次数: |
3394 次 |
最近记录: |