Eight Themes Support Documentation

How to Create Custom Page Templates

The following tutorial only applies to Online Store 2.0 themes - for clarification, that's theme version 30.0.0 and onwards.  If you're using a vintage theme version, and you'd like to create custom page templates, please update your theme to the latest version!


What is a custom Page Template?

 
Custom page templates allow you to create and utilize different page templates, with different content, across groups of products, collections, blogs, or pages. They're a great way to customize your store, and enhance your customer experience!
 
By default your theme will use the same template for all your groups of pages (so, the same template for all product pages, the same template for all collection pages etc.).  This is known as the default template, and any changes you make to this will reflect across all pages of that type. So, if you add a section to your default product page template, this section will appear on all of your default product page templates.  
 
In using custom page templates you can add different sections and create different layouts for specific pages on your store, rather than using the default template, which would give each type of page on your store the same sections and layout. You can assign a different custom Page Template to as many pages of your store as you'd like.  

How do I create a custom Page Template for a Collection, Product, Page or Blog?

 

When adding a section to a template, for example, an Image with text section to a collection page, this section will display on all collections as they share the same, default template.  When viewing a different collection page, using this same default template, the only differences will be the actual content of the collection (the products displayed, available within the selected collection).  
 
The way to get around this is to create a custom template and assign it to a collection, product, page or blog. This will allow you to now add a section independently to the new custom template only.
 
This applies to all available page templates, and the process to create a Page Template is the same, regardless of the type of template you're creating. Essentially, it involves creating, naming, assigning, and customizing the template. For this example, we'll be creating a custom Page Template for a Collection page, but you can apply the same principle to any type of template. 
 

Create the template

Open the template selector, and select the Collection option, and then click Create template. If you're creating a custom template for a different type of page, select that page type from the Home page drop-down instead.
 
Screen_Shot_2022-05-10_at_11.54.03_AM.png
 

Name the template

Name the new, custom page template. We recommend using a unique name to make this easily identifiable.


Screen_Shot_2022-05-20_at_9.38.25_AM.png

 
Note: The template will be 'based on' the default template for the page type you've selected. In this case, we're creating a custom Collection page template, 'based on' (so, featuring the same functionality as) the Default collection template. 
 

Assign the template

To assign the custom template to the specific collection, navigate to Products > Collections in Shopify admin, select the new template and click Save.  
 
Note: The theme you are customizing will need to be live in order for the template to show as available for selection.

 
Screen_Shot_2022-05-20_at_9.09.29_AM.png
 

Customize the template

Navigate to the Collection section in your theme editor, and select your new custom template. You can now add sections independently of your other Collections page templates! 

 
Screen_Shot_2022-05-20_at_9.10.53_AM.png
 
You'll now be able to create different templates for your pages, allowing you much greater flexibility and creativity with your store!  You can create as many templates as you'd like and assign them to multiple pages, or keep them standalone. 

How do I delete a template?

 

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

  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.
  4. 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.

 

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 new name, before deleting the original template.

 

Read: Shopify's help pages on Templates

Was this article helpful?