Welcome to the Eight Themes Docs

How to create custom page templates

What is a custom page template?

Use custom page templates to deploy unique content and layout settings across groups of products, collections, blogs, or pages. They're a great way to customise your store and enhance the customer experience!
By default, your theme uses the same template for each group of pages (e.g. the same template for all product pages, the same template for all collection pages, etc.). Each of these templates is known as a default template. Any change you make to the default template appears on all pages of that type. So, if you add a section to a default product page template, that section appears on all of the product pages using that template.  
With a custom page template, you can add different sections and create different layouts for specific pages on your store. In many cases, this option is better than modifying the default template, which would give each type of page on your store the same sections and layout. You can assign a custom page template to as many store pages as you like.  
 

How do I create a custom page template for a collection, product, page or blog?

Custom templates are not just for pages. You can assign them to collections, products, or blogs. In this example, we'll create a custom page template for a Collections page, but you can apply the same principle to any type of template. 
 

Step 1: Creating a template

  1. Log in to Shopify.
  2. Click Online Store > Themes > Customize.
  3. Click the template selector and select an option. In this example, we select Collections.
  4. Click Create template
e-2.png
 
Give the template a unique name. Click Create template to save the file.

The new template is based on the default template for the page type you've selected. In this example, we're creating a custom collections page template based on the default Collections template. 

e-3.png
  • The theme editor adds the custom template to the list.

e-4.png

 

Step 2: Assigning a template

The next step is to assign the custom template to a collection (in other cases, it could be a product page or blog post).
  1. Navigate to Products > Collections.
  2. Open the collection that will use the custom template.
  3. Scroll down to the Online Store heading.
  4. Click the Theme template field.
  5. Select the custom template.
  6. Click Save.
  • Note: The theme you are customising must be live. If not live, the custom template will not appear in the Theme template drop-down. 
     
    e-6.png
     

Step 3: Customize the template

Go back to the theme editor and open the custom template. Now you can add sections and change the layout in a way that does not affect the other collections! 

You can create different templates for your store pages. Custom templates give you flexibility and creativity! Create as many templates as you'd like and assign them to multiple pages or keep them as stand alones.  
 

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. Open the theme that has the template you want to delete (probably the current theme).
  3. Click the ellipsis (three-dot icon) > Edit code.
  4. Enter the name of the template in the search bar.
  5. Click the template name.
  6. Click the trash icon.
  • Note: If you have any resources assigned to the template, they will be displayed with the default template until you assign a different one.

e-7.png

Click here to see Shopify guide on custom templates for more information
 

Was this article helpful?