Adding section to a section-free theme: "This page doesn't have sections." - but it does!

Shopify Expert
8 0 2

I'm puzzled here. I feel like I've done this a dozen times before - setting up a page template that uses sections. I'm adding this to a client's theme that didn't have sections yet.

So, I:

  • Went through Online Store > Themes > Edit Code to create the initial section
  • Set up the section: about-slider.liquid
  • In my template, I included it via {% section 'about-slider' %}

When I view the page in the browser, the section is loading in; I see it in the code. BUT, when I go to Online Store > Themes > Customize, I just see "This page doesn't have sections." But, but, it does! 

This has been driving me crazy! Is there something in a theme somewhere that would stop it from allowing sections? Anyone have any insight? Any help would be appreciated!

Here's the code and section schema I'm using. Nothing crazy. And I've tried sections from other working themes and those give the same "doesn't have sections" message in the customizer.

<div class="wrapper">
	<div class="slider">
		{% for block in section.blocks %}
			<div class="slide">
				{{ block.settings.image | img_url: '1020x' | img_tag }}
			</div>
		{% endfor %}
	</div>
</div>
{% schema %}
{
  "name": "About Slider",
  "class": "about-slider",
  "max_blocks": 10,
  "settings": [
  ],
  "blocks": [
    {
      "type": "slide",
      "name": "Slide",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "Image"
        }
      ]
    }    
  ]
}
{% endschema %}

 

0 Likes
New Member
1 0 0

I got around this by making a snippet with all the html content in, imported that into the section and then imported the section into the page i wanted (cart).

 

<div class="wrapper">
	<div class="slider">		
{% for block in section.blocks %}
<div class="slide">
{{ block.settings.image | img_url: '1020x' | img_tag }}
</div> {% endfor %} </div> </div>

- In the snippet file

 

{% include 'nameOfSnippet' %}

{%
schema %} { "name": "About Slider", "class": "about-slider", "max_blocks": 10, "settings": [ ], "blocks": [ { "type": "slide", "name": "Slide", "settings": [ { "type": "image_picker", "id": "image", "label": "Image" } ] } ] } {% endschema %}

- In the section file

 

{% section 'about-slider' %} - in the template file

0 Likes
Shopify Partner
1346 22 209

Hey Steve,

Does your templates/index.liquid has the {{ content_for_index }} tag?

Also try adding a presets to your section Schema: https://help.shopify.com/en/themes/development/sections#presets

https://sections.design tips, tricks & Shopify sections
1 Like
New Member
5 0 0

Add in theme.liquid before </head> 

{{ content_for_header }}
0 Likes
New Member
1 0 0

Does your templates/index.liquid has the {{ content_for_index }} tag?

@Mircea_Piturca Solved it for me.

0 Likes