> 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?

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

Templates can be used on several page types, such as [<mark style="color:blue;">Products</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/page-categories/products), [<mark style="color:blue;">Collections</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/page-categories/collections), [<mark style="color:blue;">Blogs</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/page-categories/blogs), [<mark style="color:blue;">Blog posts</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/page-categories/blog-posts), and [<mark style="color:blue;">Pages</mark>](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-create-webpages). 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="/files/sz9Imsvh1cfEHadZbu6B" alt=""><figcaption></figcaption></figure>

#### **Step 2**

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

<figure><img src="/files/wKoRanADOa489UX5bjOo" alt=""><figcaption></figcaption></figure>

#### **Step 3**

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

* **Name** - paste the non-repeated name for the template.
* **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.

<figure><img src="/files/rjRMgaXjiDjah28Ud1z7" alt=""><figcaption></figcaption></figure>

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="/files/p0M1G3STsQCXb9IwKMq6" 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 set a collection. Here you can assign a template in the "Theme template" drop-down:

<figure><img src="/files/1r8jsNlj1oS127zCzsnf" alt=""><figcaption></figcaption></figure>

Save the changes.

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

<figure><img src="/files/MasIu7VyGHbeF64TglAE" 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="/files/FajR6iIdjYaLmZP37qF1" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/oCeIKyLOaNFoOv6Yo1Eu" 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 "Theme template" drop-down:

<figure><img src="/files/YMgg4ISyIre89XNBVd3N" alt=""><figcaption></figcaption></figure>

Save the changes.

#### **Step 5**

Now you can go back 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>](https://mpithemes.gitbook.io/unicorn-shopify-theme/dynamic-theme-sections).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-create-a-template.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
