Create page templates
Generally, you operate with the page templates that are based on the default layout file. You modify the default template or create new templates, based on it.
When creating a new project, by default, the selected framework is MVC. For this mode, you do not have to start creating a new template from scratch. You can use the default template that contains a single placeholder and then modify it further.
Once you select a template and its framework, if you require to base the template on another template at a later point in time, you can select just from the list with templates from the same framework, thus avoiding any shortcomings from switching framework.
You create and manage .NET Core templates in the Templates grid, just like the pure MVC Sitefinity CMS templates.
.NET Core templates are edited with the New page editor of the .NET Core Renderer. To be able to edit the content of a .NET Core template, you must have setup Sitefinity .NET Core Renderer.
To create a template via the UI, perform the following:
- In the main menu of your website backend, click Design » Page Templates.
- Click Create a template.
- Enter a name for your template.
- In Name used in code, enter the name that will be used to refer to the template in the code.
- In Template thumbnail, select the thumbnail that will represent the template in the backend UI.
If you want to use a custom thumbnail, click (Change) and perform one of the following:
- Select a thumbnail from the list and click Use selected.
- Click (Upload), choose an image from your computer, and click Use this image.
- Click Continue.
A list of templates group according to the framework that they are using appears.
- Select the template that you want the new template to be based on.
You can choose between MVC and .NET Core templates.
If you want to start from scratch, select the respective default template.
NOTE: The new template will inherit the framework of the template that it is based on.
: After you select a base template, the new template is created and is in status Draft
. It opens in editing mode, so that you can construct it using layout elements and widgets.
Depending on the framework that it is based on, the new template opens for editing in one of the following page editors:
When creating a page template based on another template, keep in mind the following:
- Changes of a template are applied to its child template.
- You cannot edit the parent template while editing the child template.
- If you delete a template, all of its child templates and all pages that uses this template will also be deleted.
RECOMMENDATION: When you create a nested page template, based on a layout file, we recommend selecting the MVC only option. For more information about layout base templates, see Create MVC page templates based on layout files.