Priorities for resolving views
Sitefinity CMS uses a strict convention for resolving the views for widgets. This article describes the different ways to add a view to a widget and what are the priorities for the different approaches.
Priorities for resolving views
Following is a list of the different ways to resolve views for widgets. The list is ordered by priority from highest to lower:
|
Location of view |
Description |
|
|
All resource packages, such as Bootstrap, Minimal, and so on, are located in this folder. For more information, see Resource packages. The |
|
|
After the The extension of the template file depends on your view engine. For Razor the extension is |
|
Widget templates section |
MVC widget templates can be reused. For example, the |
|
Embedded resources |
By design, the MVC widgets that come out-of-the-box, such as Navigation, Content Block, or News, have corresponding assemblies that are referenced by the SitefinityWebApp. In each of the assemblies, the views have their Build action set to Embedded resource. This way all views are included in the assemblies. This is the final place where Sitefinity CMS searches to resolve the widget view. |
Priorities for resolving assets
Telerik.Sitefinity.Frontend.FrontendService service registers a virtual path for each widget assembly and for Telerik.Sitefinity.Frontend itself. The service also registers a route handler. This way, an HTTP GET request to the same file returns it as a response: ~/Frontend-Assembly/[Assembly-Name]/[Path]
The contents of a virtual file inside the Frontend-Assembly path can come from the file system at location ~/[Path].
When not found there, it falls back to retrieving the contents of an embedded resource placed on the same path, inside the specified assembly.
For example, ~/Frontend-Assembly/Telerik.Sitefinity.Frontend/Mvc/Scripts/Angular/angular.min.js
If a file ~/Mvc/Scripts/Angular/angular.min.js exists, then it will be retrieved. Otherwise, the embedded resource Telerik.Sitefinity.Frontend.Mvc.Scripts.Angular.angular.min.js is returned.