> For the complete documentation index, see [llms.txt](https://mpithemes.gitbook.io/unicorn-shopify-theme/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-create-a-template.md).

# How to create a template?

Use the templates functionality to build a unique layout with individual content for each page of the same category.

{% hint style="warning" %}
**Note!** The templates functionality works only in the published theme.
{% endhint %}

Templates can be used across several page types, including [<mark style="color:blue;">Products</mark>](/unicorn-shopify-theme/page-categories/products.md), [<mark style="color:blue;">Collections</mark>](/unicorn-shopify-theme/page-categories/collections.md), [<mark style="color:blue;">Blogs</mark>](/unicorn-shopify-theme/page-categories/blogs.md), [<mark style="color:blue;">Blog posts</mark>](/unicorn-shopify-theme/page-categories/blog-posts.md), and Pages. Find more details on the following functionality [<mark style="color:blue;">here</mark>](https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates).

You can also follow the general steps to create a new template:

#### **Step 1**

Go to the Theme Editor and choose a page type in the top selector for which the template should be created.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2Fn50ITpKqdM6ws4ZphQoq%2Ftemplates_category.png?alt=media&amp;token=42d3bdb3-7821-4e8d-a870-7c42f9b0af46" alt=""><figcaption></figcaption></figure>

#### **Step 2**

Then, press the **"Create template"** button.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2FRcz00kPguj0ofqHN3WRh%2Ftemplates_create.png?alt=media&amp;token=4f5598f7-f614-450f-b25d-e00126cc6bee" alt=""><figcaption></figcaption></figure>

#### **Step 3**

In the pop-up, you can edit the following fields:

* **Name** - use a name for the template that is not repeated.
* **Based on** - use any template on which a new one should be based. It can be the default template or a new template created in your store earlier.

After editing the fields, press the **"Create template"** button.

#### **Step 4**

Go to Shopify admin to assign the template to the appropriate page.

* To assign a template to a **Product page**, go to *Shopify admin -> Products*, and choose a product. Here you can set a template in the "Theme template" drop-down.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2FHhDcH298Iy86EqnzE7Lx%2Ftemplate_products.png?alt=media&amp;token=ff7c6a10-47f0-422e-8da4-431c4eeafe8b" alt=""><figcaption></figcaption></figure>

Save the changes.

* If you need to use a template for a **Collection page**, go to *Shopify admin -> Products -> Collections*, and select a collection. Assign a template in the "Theme template" drop-down.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2FTQFcFYadVjIS64oSdPF4%2Ftemplate_collection.png?alt=media&amp;token=c4ed8ada-db77-4005-8da7-97cf98b4f539" alt=""><figcaption></figcaption></figure>

Save the changes.

* In your *Shopify admin -> Content -> Blog posts*, choose the **Blog post** and press it. Apply a template by selecting the one in the "Theme template" drop-down.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2FCuvVyfyduMLSEtOWnKei%2Fblog%20post_template.png?alt=media&amp;token=578da8eb-19be-4150-a843-675e18f87b5c" alt=""><figcaption></figcaption></figure>

Save the changes.

* In the "Blog posts" section of your admin, you can also assign a template for a **Blog**. To set up a template, press the "Manage blogs" button at the top right and select a blog. Then, follow the same steps as before.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2FhNHTJYo8QEjClP3UMUJD%2Fblog_manage.png?alt=media&amp;token=c72ade21-c3b6-449b-b3f6-26a8b2ab1eba" alt=""><figcaption></figcaption></figure>

In the next step, you can use the "Theme template" drop-down to add a template.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2FvbbclDJZK6BnnxWIIDkx%2Fblog_template.png?alt=media&amp;token=f2cde8ff-7b08-41f6-8128-d74b500e5ea6" alt=""><figcaption></figcaption></figure>

Save the changes.

* To assign a template to a **Page**, navigate to *Shopify admin -> Online Store -> Pages*, and choose a page. Then, select the created template in the "Template" drop-down.

<figure><img src="https://2943342198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysL5Hr1ZCl3x5RHWgJ3m%2Fuploads%2FRP6ZdvrZCDQmtaJiRf3V%2Ftemplate_page.png?alt=media&amp;token=3fa74405-5771-45d1-9eec-ac295176fb7b" alt=""><figcaption></figcaption></figure>

Save the changes.

#### **Step 5**

You can now return to the Theme Editor and customize a template. With this functionality, you can customize each template by adding various sections and blocks independently. Use the Theme Sections to customize a template. Read more on how to add and edit each section [<mark style="color:blue;">here</mark>](/unicorn-shopify-theme/dynamic-theme-sections.md).
