Help Center
English
Contents

Manage page templates in the code editor

Create, delete and rename page templates in the code editor, and undo each change.

You can create, delete and rename page templates in the code editor, on the live theme or a copy. On the live theme, each change applies to your storefront right away. The default theme's templates can't be changed here.

Create a template

Add a file in templates/ named after its page type: templates/<page_type>.json. For example, templates/product__summer.json is an alternate product template. Give it a "name": it's the name you choose when you assign the template.

A new template is checked the way a theme upload is: every section in it must be allowed on that page, and the page's required sections must be there.

Delete a template

A template can't be deleted, here or in the theme editor, while products, collections, pages, blog posts, blog categories, categories, brands or vendors are assigned to it. Give those items another template first.

A page type's default template, such as templates/product.json, can't be deleted, and neither can a template that one of the theme's styles ships.

Rename a template

A template can't be renamed while products, collections, pages or other items are assigned to it. Give those items another template first, then rename it.

Undo a template change

Every create, delete and rename is one change in Theme code history, and you can undo it. Undoing a create deletes the template, with the same rules as a delete. Undoing a rename renames the template back, with the same rules as a rename.

Was this page helpful?