---
title: Using page templates in MVC
related:
  - https://docs.kentico.com/k12sp/managing-website-content/using-widgets-in-mvc.md
  - https://docs.kentico.com/k12sp/developing-websites/page-builder-development/developing-page-templates-in-mvc.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Page templates allow you to gain greater control over the layout of pages, without the need to ask a developer to modify the code of your MVC project. When  [creating a page](https://docs.kentico.com/k12sp/managing-website-content/working-with-pages/creating-new-pages-in-mvc.md), you can choose from two types of page templates:

- **Default templates** are defined in the code of an MVC project by developers. They only specify the layout of a page, waiting for the content to be added.
- **Custom templates** are always based on a default template. On top of the layout defined in the original default template, custom templates also incorporate a snapshot of page builder content (such as widgets and sections). This page builder content serves as a starting point for new pages and can then be adjusted for each page (there is no permanent "link" between the content of pages using the same template). Structured page data edited on the _Content_ tab of a page is not saved within custom templates. To create custom templates, [save existing pages as templates](#saving-pages-as-custom-page-templates).

## Creating pages based on page templates

To create a page based on a template, follow the instructions on the [Creating new pages in MVC](https://docs.kentico.com/k12sp/managing-website-content/working-with-pages/creating-new-pages-in-mvc.md) page.

The page template selection dialog may only be available for certain types of pages (or rely on other factors, such as the page culture and location within the content tree). The available template options depend on your site's implementation. If you are a developer and wish to learn how to create default templates, see [Developing page templates in MVC](https://docs.kentico.com/k12sp/developing-websites/page-builder-development/developing-page-templates-in-mvc.md).

### Configuring page templates

You can configure a page template to further control the overall appearance of the page.

1. Open the **Pages** application.
2. Open a page based on a template and switch to the  **Page** tab.
3. Click the orange configure button () located in the bottom-left corner of the page window.

   ![Clicking the configure button](https://docs.kentico.com/docsassets/k12sp/using-page-templates-in-mvc/configure_template.png "Clicking the configure button")
4. Configure any available properties in the dialog.

   ![Configuring a page template](https://docs.kentico.com/docsassets/k12sp/using-page-templates-in-mvc/templates_dialog.png "Configuring a page template")
5. Click  **Apply**.

The configured properties now apply to the template **for the given page**. Any other pages that use the same template have their own separate property configuration. Depending on the available properties, the changes are reflected in the page's appearance or behavior on the website.

### Changing templates of existing pages

You can change the page template of an existing page, provided there is more than one page template available for the given page.

> **Note:** **Content not preserved when changing templates**
>
> When changing the template of an existing page, all page content (i.e. widgets and sections with their data and properties) is lost. You should therefore change templates only in the early stages of page development. 

1. Open the **Pages** application.
2. Select a page based on a template and switch to the **Page** tab.
3. Click the orange change template button () located in the bottom-left corner of the page preview window.

   ![Change template button.](https://docs.kentico.com/docsassets/k12sp/using-page-templates-in-mvc/change_template_button.png "Change template button.")
4. Select one of the available default or custom templates.

   ![Changing page template of an existing page](https://docs.kentico.com/docsassets/k12sp/using-page-templates-in-mvc/change_template.png "Changing page template of an existing page")
5. Click **Apply**.

## Saving pages as custom page templates

If you want to reuse page builder content, such as the layout of sections or content of widgets, you can save template-based pages as custom templates. Structured page data (edited on the _Content_ tab of a page) is NOT saved within custom templates.

1. In the content tree in the  **Pages** application, navigate to a location where page templates are enabled.
2. [Create a new page](https://docs.kentico.com/k12sp/managing-website-content/working-with-pages/creating-new-pages-in-mvc.md) based on an existing default template.
3. [Edit the page](https://docs.kentico.com/k12sp/managing-website-content/working-with-pages/editing-pages-in-mvc.md) to add some content. You need to  **Save** the edited page before you can proceed to the next step.
4. Click the expand () button in the upper-right corner to show more actions and select **Save as template**. A dialog box opens.

   ![](https://docs.kentico.com/docsassets/k12sp/using-page-templates-in-mvc/expand+button.png)
5. Type a **Template display name**.
6. (Optional) Add a **Template description**  and upload a **Thumbnail**  image for the template.
7. Click **Save**.

You now have a custom template which you can select when creating new pages that support the original default template. Such pages automatically start with the page builder content stored within the custom template, and can then be further adjusted. Changes made in the content of one page do NOT affect the content of other pages that use the same custom page template.

## Managing existing page templates

You can see a list of all custom page templates on your site in the  **Page templates (MVC)**  application. In this application you can  **Delete** () custom page templates.

![](https://docs.kentico.com/docsassets/k12sp/using-page-templates-in-mvc/page_templ_app.png)
