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?
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.
Name the template
Name the new, custom page template. We recommend using a unique name to make this easily identifiable.
Assign the templateTo assign the custom template to the specific collection, navigate to Products > Collections in Shopify admin, select the new template and click Save.
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!
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.
- From your Shopify admin, go to Online Store > Themes.
- Find the theme you want to delete a template from, and then click Actions > Edit code.
- 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 new name, before deleting the original template.
Read: Shopify's help pages on Templates.