Before you populate your page with content, you create a layout that define how content is positioned and displayed. For example, you allocate space for the navigation, the header, and the content blocks. To do this, you use predefined or custom page templates, which you can modify if needed. You define the appearance and style of the page by setting the template and applying it to pages.
To see and manage the list of all templates that your website pages are based on, navigate to Design » Page templates.
In Sitefinity CMS, you can work with three types of page templates, depending on the technology you use and the widgets you place on pages. The mode you use depends on your development process as well as the functionality you want to implement.
The following sections summarize the template types, along with an overview when and how you use them.
In MVC mode, you directly control the markup of templates. You work with Razor layout files and leverage the set of grid widgets, provided by the resource package. Grid widgets help you customize your layout by dropping them on your pages. Each grid widget on a page forms one or several placeholders for your other widgets (depending on the page template). When working with MVC-only templates, you do not need to work with the Responsive and Mobile design module since the MVC framework is mobile-first. Responsive design is provided by the CSS framework, used in the Bootstrap package.
Working in MVC mode is the recommended way to work in Sitefinity CMS, especially for new projects. Development process is optimized and modification of your website functionality and appearance – quick and easy.
For more information, see:
When working with Web Forms, you base your page templates on .master files and define the appearance and style of the page by setting the template and the theme.
For more information, see Create hybrid or Web Forms template using a Master page.
For more information about setting WebForms and hybrid templates through the code, see For developers: Apply page templates.
Hybrid mode lets the template and all pages, based on it, use both MVC widgets and Web Forms widgets on the same page. Thus, if you have legacy pages with Web Forms widgets, say with Forums, you can still take advantage of MVC technology benefits.
When you create a hybrid template, Sitefinity CMS creates a page object, but also routes to all MVC controllers that you have on the page and inserts their markup into the output. This works in exactly the same way that ASP.NET MVC does, so you can fully expect your widgets to behave like they would normally.
However, you need to be aware of the specifics and dependencies the two technologies entail.
For more information, see Dependencies when working with hybrid page templates.
To see and manage all templates that your website pages are based on, navigate to Design » Page templates. The Templates list provides you with details about each template, including:
MVC only templates
The layout file, on which the current MVC template is based on or a link to an existing page template, on which the current template is based. The system automatically generates the location path of the layout file based on Sitefinity CMS MVC templates conventions, for example, \ResourcePackages\Bootstrap4\Mvc\Views\layouts\default.cshtml. For more information, see Map new templates to a file in the file system.
Thus, you can easily check the resource package that the template uses, for example, Bootstrap4. You can also see how many pages use this template.
NOTE: If you modify the template name or delete the template altogether, you can still see the template in the list, along with the original automatically generated path.
Keep in mind that when creating a new MVC template from scratch, even when you do not base it on any existing template, the system still automatically generates the path where the layout file should be located, based on conventions. For more information, see For developers: Create MVC page templates based on layout files.
Web Forms and Hybrid templates
The master file, on which the template is based or a link to an existing page template, on which the current template is based.
The easiest way to apply a template to a page is to use the predefined set of MVC only and hybrid templates. For more information, see Apply page templates.
You can also create layout templates in the Layout editor from scratch or modify existing ones. In addition, you can create a custom template and apply it to pages. For more information, see Design page templates in the Layout editor.
NOTE: When working with Web Forms or hybrid templates, you base the page templates on .master files.
You can create personalized version of each page. Personalizing a page gives you the opportunity to serve different content to different types of users (user segments). You can build set of rules on which the user segments are based.
For more information, see Create a personalized version of a page.
Back To Top
Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.