Hello! I am trying to use alternate layouts on my store. I looked at the The Power of Alternate Layout Files in Shopify Theme Development article but it’s from 2016 and I cannot find out how layouts are referenced in Online Store 2.0. I’ve spend some time crawling through searches in VS Code as well but cannot tell where the layout is referenced. Any help is appreciated. Thanks!
Hi @brendan-widmer ,
It’s customization work, for that you need to hire a developer or need a developer help,
to add this feature with custom code.
You can contact (https://www.halothemes.com/contact) for support.
If you find this answer helpful, please mark it as a SOLUTION.
Best regards.
yes can you try that if any issue share us
Yes the issue is that the article is based on the old file system where templates are .liquid instead of .json. The .json files do not allow for referencing different layouts. At least not that I can find!
Just add a layout attribute in the JSON template like you do with order and section. Add the layout name without the extension.
Example: “layout”: “gift_card”,
Thank you, this was very helpful and I feel like went unnoticed.
The dev for the “layout” property for JSON templates in OS2.0 themes:
https://shopify.dev/docs/themes/architecture/layouts
https://shopify.dev/docs/themes/architecture/templates/json-templates#schema