Templates

Templates are a collection of sections that are configured to give your online store a consistent look and feel. Which sections are available in your templates depends on your theme. In the theme editor, you can discover which templates are applied to which pages, and then edit them to customize the information displayed to your customers.

Editing a template applies the changes to every page that uses that page template. For example, if you add a newsletter signup form to a collection template, then all collections pages that use the default collection template now display the newsletter signup form.

Edit templates

You can edit your templates to add sections to your online store. Some sections enable you to add blocks that can be further customized, but not every section or block has settings or content that can be edited. When you edit your templates, your changes are displayed in real time in the theme preview window.

Steps:

  1. Select the template that you want to edit from the dropdown menu
  2. Click + Add section, and then select a new section for your template.
  3. Click the new section to view its settings and options.
  4. Make your changes to the section or the blocks within it.
  5. 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 come with a default template for each type. This default template is what resources use if you don't have an alternate template explicitly set.

Any changes you make to a template will impact all pages that use that template. If you want to display some pages of that type differently, then you can create a new template based on one that already exists in your theme. Creating a new template from an existing template automatically populates your new template with the same sections, which you can then edit to remove, add, or hide sections as needed without impacting the display of other templates of that type.

Steps:

  1. Use the dropdown menu to select a template. Click + Create template.
  2. Give your template a unique name.
  3. Using the dropdown menu, select which existing template you want to base your new template on.
  4. Click Create template.

Template previews

Template previews let you see how a template will display different resources to your customers when you save or publish. You can use template previews to preview how your pages or products appear with a different template applied.

Templates are assigned on a page or product level. You create and edit templates in the theme editor, but you change a page or product's assigned template in your Shopify admin. You can have multiple templates for your pages and products.

Preview an alternate template

You can preview how your pages or products appear with a different template applied.

Steps:

  1. Use the dropdown menu to select a template.
  2. In the sidebar, click Change.
  3. Select the product or page you want to preview with the selected template.

Apply a new template

You can change an assigned template for:

  • pages
  • products
  • collections
  • blogs
  • blog posts

Changing an assigned template is done in your Shopify admin. Templates can be assigned on an individual item level, or to multiple items using Bulk Actions. This is done outside the theme editor.

Steps:

  1. Click the title of the store page.
  2. In the Online store section, use the dropdown menu to select a new theme template to apply to the selected page.
  3. Click Save.

Apply a new template to a product

  1. From your Shopify admin, go to Products > All products.

  2. Use the search filter to locate the product that you want to change, or click on the product from the list of existing products.

  3. In the Online store section, use the dropdown menu to select a new theme template to apply to the selected product.

  4. Click Save.

Apply a new template to a collection

  1. From your Shopify admin, go to Products > Collections.
  2. Use the search filter to locate the collection that you want to change, or click on the collection from the list of existing collections.
  3. In the Online store section, use the dropdown menu to select a new theme template to apply to the selected collection.
  4. Click Save.

Apply a new template to a blog post

  1. Use the search filter to locate the blog post that you want to change, or click on the product from the list of existing blog posts.
  2. In the Online store section, use the dropdown menu to select a new theme template to apply to the selected blog post.
  3. Click Save.

Apply a new template to a blog

  1. Use the search filter to locate the blog that you want to change, or click on the product from the list of existing blogs.
  2. In the Online store section, use the dropdown menu to select a new theme template to apply to the selected blog.
  3. Click Save.

Bulk template changes

You can use the Bulk editor to apply a new template to several pages, products, collections, or blog posts at once.

Bulk edit products or collections

  1. From your Shopify admin, go to Products and click on either All Products or Collections.
  2. Use the search filter to locate the products or collections that you want to change.
  3. To update multiple products or collections at the same time, use the following shortcuts:
    • To select and edit multiple products or collections at the same time, click the checkbox of the items that you want to edit.
    • To select a range of products or collections, click a checkbox, then hold the shift key and click another product or collection checkbox.
    • To select multiple adjacent products or collections, click to select an item, then hold the shift key and click another item checkbox.
  4. Click Edit products or Edit collections.
  5. In the Bulk editor, click the Add fields dropdown menu, and then select General > Template.
  6. Click on the template field of the first line, then hold the shift key and click the template field of the last line. A thin box will appear around the items you have selected.
  7. Using the dropdown menu, choose a new template for the selected items.
  8. Click Save.

Bulk edit pages or blog posts

  1. From your Shopify admin, go to Online Store and click on either Pages or Blog posts.
  2. Use the search filter to locate the pages or blog posts that you want to change.
  3. To update multiple pages or blog posts at the same time, use the following shortcuts:
    • To select and edit multiple pages or blog posts at the same time, click the checkbox of the items that you want to edit.
    • To select a range of pages or blog posts, click a checkbox, then hold the shift key and click another page or blog post checkbox.
    • To select multiple adjacent pages or blog posts, click to select an item, then hold the shift key and click another item checkbox.
  4. Click Edit pages or Edit blog posts.
  5. In the Bulk editor, click the Add fields dropdown menu, and then select General > Template.
  6. Click on the template field of the first line, then hold the shift key and click the template field of the last line. A thin box will appear around the items you have selected.
  7. Using the dropdown menu, choose a new template for the selected items.
  8. Click Save.

Bulk edit blogs

  1. To update multiple blogs at the same time, use the following shortcuts:
    • To select and edit multiple blogs at the same time, click the checkbox of the items that you want to edit.
    • To select a range of blogs, click a checkbox, then hold the shift key and click another blog checkbox.
    • To select multiple adjacent blogs, click to select an item, then hold the shift key and click another item checkbox.
  2. Click Edit blogs.
  3. In the Bulk editor, click the Add fields dropdown menu, and then select General > Template.
  4. Click on the template field of the first line, then hold the shift key and click the template field of the last line. A thin box will appear around the items you have selected.
  5. Using the dropdown menu, choose a new template for the selected items.
  6. Click Save.

Template FAQs

How do I delete a template?

To delete a template, you need to use the code editor.

Steps:

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find the theme you want to delete a template from, and then click Actions > Edit code.
  3. In the code editor, find the templates folder. Click on the name of the template you want to delete, and then click Delete file. If you have any resources assigned to that template, they will be displayed with the default template until you assign a different one.

How do I change my template's name?

You can't change a template's name after it has been created. If you want a template with a new name, then you can create a new template based on the old one, and give it the desired name before deleting the original template.

Ready to start selling with Shopify?

Try it free