Re: Adding new dynamic Sections to the "Add section" menu in 2.0

Solved

Adding new dynamic Sections to the "Add section" menu in 2.0

Ross_Angus
Shopify Partner
15 0 5

At the bottom of the theme settings sidebar in 2.0, there's an "Add section" button, which pulls up a menu of some of the Sections from the sections folder:

add-section-button.png

While the documentation is clear on how to restrict a specific section to one (or more) templates, I can't find any way to white-list a section so it automatically appears within this "Add section" menu.

Additionally, it's possible to add a Section automatically to a template, but I'm not sure how to allow a Shopify user to add a Section when it's not already on the page.

Have I just overlooked something in the documentation?

Accepted Solution (1)

LitExtension
Shopify Partner
4860 1002 1160

This is an accepted solution.

Hi @Ross_Angus,

This means you already have created sections but it's not showing in "add section".

If so, you just need to add "presets" to the schema, it will display fine. Refer https://i.imgur.com/eD0hOit.png

Ex code:

"presets": [
    {
      "name": "Featured blog",
      "settings": {
        "blog": "News"
      }
    }
  ]

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify

View solution in original post

Replies 4 (4)

LitExtension
Shopify Partner
4860 1002 1160

This is an accepted solution.

Hi @Ross_Angus,

This means you already have created sections but it's not showing in "add section".

If so, you just need to add "presets" to the schema, it will display fine. Refer https://i.imgur.com/eD0hOit.png

Ex code:

"presets": [
    {
      "name": "Featured blog",
      "settings": {
        "blog": "News"
      }
    }
  ]

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Ross_Angus
Shopify Partner
15 0 5

Thanks, @LitExtension. I just did not spot that in the documentation.

ChrisMerlin
Shopify Partner
7 0 0

Where is that in the documentation?

 

And, in what file are you making that edit?

ChrisMerlin
Shopify Partner
7 0 0

Figured it out. The presets code is added to the bottom of the section page created.
What's important however is that the "name" needs to exactly match the name at the top.

{% schema %}

{
"name": "My Table Section",
"tag": "section",