Limit which Sections can appear on which pages?

Solved
kristofer-fzco
New Member
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!

0 Likes
jehuty15
Shopify Partner
2 1 1

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
New Member
2 0 0

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

0 Likes