Widget templates

Sitefinity CMS widgets are standard MVC widgets that you can find in the widget toolbox. You place the widgets on any page or template to add specific content or functionality. Each widget provides you with options to configure the widget's preferences in the user interface. For example, the News widget has options for selecting which news to display, how to sort them, and how many news items are rendered on the page.

You can modify the default widget templates directly in the file system without any need to build your project to apply the changes.  You can also control the rendered HTML and modify the markup of default widget templates according to your preferences. To edit a widget template, you simply edit the markup of the widget. You can create new widget templates either in the file system or from the backend.  For information about file priorities, see Priorities for resolving views.

NOTE: When creating and activating a dynamic module, Sitefinity CMS automatically creates a Dynamic content widget for this module. There are slight differences in how you work with Dynamic content widget templates, as well as the naming conventions for files and folders. For more information, see Naming conventions.

Widget templates are located in the ResourcePackages folder of the Bootstrap package that Sitefinity CMS uses, or in the root folder of your project.

NOTE: If you are not using any resource package, the default templates are located in Sitefinity CMS assemblies, so you can override them in the root of the project, or create new ones. Thus, widget templates are not coupled with any resource package.

For more information about frontend frameworks, see Resource packages.

RECOMMENDATION: We recommend that you store the widget templates in your resource package. For information about file priorities, see Priorities for resolving views.

You manage widget templates on Widget templates page. To open the page, in the main menu, click Design » Widget Templates.

This section contains

Priorities for resolving views
Learn about the strict convention for resolving the views for MVC widgets. Understand the ways to add views to widgets and the priorities for the different approaches.
Create and edit widget templates
Modify widget templates in the file system, control the rendered HTML and markup of the widget. Create new widget templates, based on existing ones.
Use custom fields in widget templates
Display custom fields and the information they represent on the frontend of your website by adding them to content widget templates.
Precompile widget templates
Precompile widget templates to avoid initial rendering delay upon request, be it on the frontend or in the backend.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
New to Sitefinity?