Solved

Can schema presets be made to only show on specific templates?

StevieW
Shopify Partner
12 1 6

Hey

 

The title pretty much covers it, I think?

 

We have a lot of presets, and when people are building out templates inside the theme editor, the list is getting bigger every day so it becomes hard to navigate, and for some presets, we don't want them being able to be added on certain pages.

 

So, is there any way to apply restrictions to presets?

 

Cheers

Accepted Solution (1)
LitExtension
Shopify Partner
4860 1001 1135

This is an accepted solution.

Hi @StevieW,

You can refer https://shopify.dev/themes/architecture/sections/section-schema#templates

You can use templates, it will help you to manage display in templates.

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 5 (5)

LitExtension
Shopify Partner
4860 1001 1135

Hi @StevieW,

It's not really clear for someone to check.

Are you referring to 'default' in the Schema?

Please describe it more, I will help you check it

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
StevieW
Shopify Partner
12 1 6

Hi @LitExtension 

 

I'll attach an image to better show what I mean.

 

Say I'm inside the theme editor and editing the home page, I can update / edit existing sections & blocks and at the bottom is the '+ Add Section' button. When clicked, it brings up a list of sections that can be added.

 

I know I can remove the 'preset' part of the section schema to stop them showing here, but I want a little more control. Currently, when you click this button, to my knowledge, every possible section with a preset is shown, but I'd like to curate this list so depending on the template I'm editing, only specific presets show?

 

We have around 30+ presets currently, and this is increasing quickly, so not only am I trying to keep the list a little more manageable, I'm also trying to avoid people just plonking down a section anywhere they please.

 

Hope that's a little clearer, and thanks!

 

dfgdf.png

LitExtension
Shopify Partner
4860 1001 1135

This is an accepted solution.

Hi @StevieW,

You can refer https://shopify.dev/themes/architecture/sections/section-schema#templates

You can use templates, it will help you to manage display in templates.

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
StevieW
Shopify Partner
12 1 6

Brilliant, thank you!

 

That allows me to restrict to template types, so all collections, all pages, etc, but what if I want to restrict to a specific template, say 'collection.new-template'? 

 

I tried "templates": ["collection.new-template"] and it didn't work - just wondering if there is a way to be more specific?
 
Have marked as a solution, as regardless of whether or not I can be more specific, this still helps massively, so thank you!
 
Cheers
LitExtension
Shopify Partner
4860 1001 1135

Hi @StevieW,

As far as I know, it's not possible.

Or you can contact Shopify directly, they will explain the details for you

 

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