Pages (templates): overview
Names Pages and Templates can be used as synonyms in this case. In Shopify documentation, templates are often referred to as pages.
⬇️ On this page:
Pages (templates): overview
Templates are configured sections that give your online store a consistent look and feel. In the theme editor, you can discover which templates are applied to pages and customize the displayed information. Editing a template applies changes to every page using that template. For example, adding a newsletter signup form to a collection template displays it on all collections pages. You can have up to 1000 templates.
Elevated default templates include:
- Products ↗
- Collections ↗
- Collection list ↗
- Cart ↗
- Pages ↗
- Blogs ↗
- Blog posts ↗
- Search ↗
- Password ↗
- 404 page ↗
- Checkout and customer accounts ↗
Shopify's resources:
Managing templates
Editing a template applies changes to all pages that use that template. For instance, adding a newsletter signup form to a collection template displays the form on all collection pages using the default template.
Steps
- From your Shopify admin, go to Online Store > Themes ↗.
- Find the theme that you want to edit, and then click Customize.
- Select the template that you want to edit from the Template drop-down menu.
- Click + Add section, and then select a new section for your template.
- Click the new section to view its settings and options.
- Make your changes to the section or the blocks within it.
- When you're satisfied with your section, click Save.
Create a new template
Some template types can be used to display multiple pages using the resources in your store. These template types include:
- collections
- products
- blogs
- blog posts
- pages
All themes have a default template for each type. This template is used by resources when no alternate template is set.
Modifying a template affects all pages that use it. To display certain pages differently, create a new template based on an existing one in your theme. This automatically fills your new template with the same sections, which you can edit to remove, add, or hide sections as needed without affecting the display of other templates of that type.
Steps
- From your Shopify admin, go to Online Store > Themes ↗.
- Find the theme that you want to edit, and then click Customize.
- Use the Template drop-down menu to select a template. Click + Create template.
- Give your template a unique name.
- Using the Template drop-down menu, select which existing template you want to base your new template on.
- Click Create template.
Create a template for a web page for metaobjects
You can create a template for a web page for metaobjects.
To use this feature, you need to complete the following steps:
- Create a metaobject definition ↗ with Storefront access ↗ and, optionally, activate the Web pages feature manually ↗. When you create a theme template, the theme editor activates the Web pages feature.
- Create entries for the metaobject definition ↗.
You can now create a theme template.
Steps
- From your Shopify admin, go to Online Store > Themes.
- Find the theme that you want to edit, and then click Customize
- Open the page selector at the top of the page.
- Click Create metaobject template. In the dialog, click the metaobject that you want to use for your template. You can edit what metaobject field is used for the Page title and the Meta description, and you can edit the URL handle in the Search engine listing section. The template is automatically named with the same name as your metaobject definition.
- Click Create template.
- After you create the template, you can add sections, add blocks, and edit settings to customize the template. You can use dynamic sources to connect your metaobject definition fields. For example, if you're creating pages for your ambassador with images, then you might want to add in an image with text and then connect the metaobject entries by clicking the dynamic source icon.
- Click Save.
Template previews
You can only preview pages and products that have an active status in your Shopify admin.
Template previews allow testing how a template will display different resources to customers when saved or published. Use template previews to preview how pages or products display with a different template applied.
Templates are assigned on a page or product level. Create and edit templates in the theme editor, but change a page or product's assigned template in your Shopify admin. Multiple templates can be used for pages and products.
Steps
- From your Shopify admin, go to Online Store > Themes.
- Find the theme that you want to edit, and then click Customize.
- Use the Template drop-down menu to select a template.
- In the sidebar, click Change.
- Select the product or page you want to preview with the selected template.
Apply a new template
You can change an assigned template for the following sections in a published theme:
- pages
- products
- collections
- blogs
- blog posts
Changing an assigned template is done in your Shopify admin. The template options that display are based on the available templates in the current live theme.
Templates for products and collections can be assigned on an individual item level, or to multiple items using the Bulk editor ↗. This is done outside the theme editor.
Steps to add a new template to a page
- From your Shopify admin, go to Online Store > Pages ↗.
- Click the title of the store page.
- In the Online store section, use the drop-down menu to select a new theme template to apply to the selected page.
- Click Save.
Steps to add a new template to a product
- From your Shopify admin, go to Products ↗.
- Use the search filter to locate the product that you want to change, or click the product from the list of existing products.
- In the Online store section, use the drop-down menu to select a new theme template to apply to the selected product.
- Click Save.
Steps to add a new template to a collection
- From your Shopify admin, go to Products > Collections.
- Use the search filter to locate the collection that you want to change, or click the collection from the list of existing collections.
- In the Online store section, use the drop-down menu to select a new theme template to apply to the selected collection.
- Click Save.
Steps to add a new template to a blog post
- From your Shopify admin, go to Online Store > Blog Posts.
- Use the search filter to locate the blog post that you want to change, or click the product from the list of existing blog posts.
- In the Online store section, use the drop-down menu to select a new theme template to apply to the selected blog post.
- Click Save.
Steps to add a new template to a blog
- From your Shopify admin, go to Online Store > Blog Posts ↗.
- Click Manage blogs.
- Use the search filter to locate the blog that you want to change, or click the product from the list of existing blogs.
- In the Online store section, use the drop-down menu to select a new theme template to apply to the selected blog.
- Click Save.
Bulk template changes
You can use the Bulk editor to apply a new template to several products or collections at the same time.
Steps to bulk edit products
- From your Shopify admin, go to Products ↗.
- Use the search filter to locate the products that you want to change.
- To edit multiple products at the same time, use the following shortcuts:
- To select and edit multiple products at the same time, click the checkbox of the items that you want to edit.
- To select a range of products, click a checkbox, then hold the shift key and click another product checkbox.
- To select multiple adjacent products, click to select an item, then hold the shift key and click another item checkbox.
- Click Bulk edit.
- In the Bulk editor, click the Columns drop-down menu, and then in the General section, click the Template checkbox.
- Click the template field of the first line, then hold the shift key, and then click the template field of the last line. A blue shading will appear around the items you have selected.
- Using the drop-down menu, choose a new template for the selected items.
- Click Save.
Steps to bulk edit collections
- From your Shopify admin, go to Products > Collections ↗.
- Use the search filter to locate the collections that you want to change.
- To edit multiple collections at the same time, use the following shortcuts:
- To select and edit multiple collections at the same time, click the checkbox of the items that you want to edit.
- To select a range of collections, click a checkbox, then hold the shift key and click another collection checkbox.
- To select multiple adjacent collections, click to select an item, then hold the shift key and click another item checkbox.
- Click Bulk edit.
- In the Bulk editor, click the Columns drop-down menu, and then in the General section, click the Template checkbox.
- Click the template field of the first line, then hold the shift key, and then click the template field of the last line. A blue shading will appear around the items you have selected.
- Using the drop-down menu, choose a new template for the selected items.
- Click Save.
Rename and Delete templates
To rename or delete your template, you need to use the code editor. Editing your template file might cause issues to your online store.
Steps to rename a template
- From your Shopify admin, go to Online Store > Themes ↗.
- Find the theme with the template that you want to rename, and then click the ... button > Edit code.
- In the code editor, find the templates folder. Click the name of the template that you want to rename, and then click Rename file.
- Enter the new template name, and click Rename file to save.
Delete a template
- From your Shopify admin, go to Online Store > Themes ↗
- Find the theme you want to delete a template from, and then click the ... button > Edit code.
- In the code editor, find the templates folder. Click the name of the template that you want to delete, and then click Delete file. If you have any resources assigned to that template, then they're displayed with the default template until you assign a different one.