Changing the layout in the Section not the template.json

DanWG
Shopify Partner
7 0 0

My theme is a Shopify 2.0 theme.

 

Basically, for a virtual exhibition, we want all the products with a specific vendor to use an alternative layout. I used to do this with the {% layout 'alt-name' %} tag in the template.liquid, but now they are all .json the layout seems to have to be defined for the whole product template.

I have tried adding the layout tag in the section but it doesn't seem to be working.

 

My question is does the layout of the page have to be defined in the template file or can it be defined in the section?

 

If it can't be done I'll just have to bilk edit all the products for that vendor a new product template then change it back after the event. Just feels like there is a more automated way to do it in the temporary theme.

Replies 2 (2)

kriszti
Shopify Partner
60 0 7

Hello, it took me an hour to figure it out. My alternate template is called theme.abc.liquid. The code for the json template is below. The double quotes around the string that is the theme name was very important. For no layout use the value "false"

 

 

{ "layout": "theme.abc",
  "sections": {
    "15e70f54-ba87-4d5c-95c9-b8daacc54584": { ...

 

 

DanWG
Shopify Partner
7 0 0

Is that in your template.json or section.liquid?