What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Limit which Sections can appear on which pages?

Solved

Limit which Sections can appear on which pages?

kristofer-fzco
Visitor
2 0 0

With the new theme 2.0 functionality, we have sections everywhere which is great. However, for large sites, having to scroll through dozens of section types when using theme editor seems like a real chore. Is there a way of limiting which sections can appear on which pages? As an example maybe the Product page has very specific sections that wouldn't appear anywhere else on the site so therefore, no need to show them in the "Add Section" for Homepage.

 

Thanks!

Accepted Solution (1)

jehuty15
Shopify Partner
4 1 2

This is an accepted solution.

checkout this post here: https://www.shopify.com.au/partners/blog/how-to-create-your-first-shopify-theme-section

For your use case, add this code to the schema within your section file, so it can only appear on product pages:

"templates": ["product"],

 

 

View solution in original post

Replies 2 (2)

jehuty15
Shopify Partner
4 1 2

This is an accepted solution.

checkout this post here: https://www.shopify.com.au/partners/blog/how-to-create-your-first-shopify-theme-section

For your use case, add this code to the schema within your section file, so it can only appear on product pages:

"templates": ["product"],

 

 

kristofer-fzco
Visitor
2 0 0

Yep! This works. I can't believe it's not documented in the actual documentation!