Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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:
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?
Solved! Go to the solution
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!
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!
Where is that in the documentation?
And, in what file are you making that edit?
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",
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024