# 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:

<table>
<tbody>
<tr>
<td>

<strong>Location of view</strong>

</td>
<td>

<strong>Description</strong>

</td>
</tr>
<tr>
<td>

`ResourcePackages` folder

</td>
<td>

All resource packages, such as Bootstrap, Minimal, and so on, are located in this folder. For more information, see [Resource packages](https://www.progress.com/documentation/sitefinity-cms/overview-resource-packages-mvc).

The `ResourcePackages` folder is located in the root of the project: `~/ResourcePackages/`.

</td>
</tr>
<tr>
<td>

`MVC` folder

</td>
<td>

After the `ResourcePackages` folder, Sitefinity CMS searches for your widget template in the `MVC` folder, located in the `SitefinityWebApp` project. To match the views with their respective widget, when naming the views, you must follow the naming convention `~/MVC/Views/ContentBlock/[ViewName].[extension]`.

The extension of the template file depends on your view engine. For Razor the extension is `.cshtml`.

</td>
</tr>
<tr>
<td>

Widget templates section

</td>
<td>

MVC widget templates can be reused.\
Sitefinity CMS first searches for your widget templates in the <em>Design</em> » <em>Widget Templates</em> section in the backend. By default, only templates of dynamic modules are automatically added on top the <em>Widget templates</em> section in the backend. You can create a custom widget template, as well, following the naming conventions. For more information, see [Work with widget templates](https://www.progress.com/documentation/sitefinity-cms/create-and-edit-widget-templates-mvc).

For example, the `List.NewsList` template is the list template of the <em>News</em> widget. If you have a file with `List.NewsList` name in `[YourPackage]/MVC/Views/News` folder, Sitefinity CMS loads the template from this folder. In case there is no such template in this location, Sitefinity CMS searches for a template with the same name in the <em>Design</em> » <em>Page templates</em> section in the backend. If there is no template with this name in this location, Sitefinity CMS gets the default template from the assemblies.

</td>
</tr>
<tr>
<td>

Embedded resources

</td>
<td>

By design, the MVC widgets that come out-of-the-box, such as <em>Navigation</em>, <em>Content Block</em>, or <em>News</em>, have corresponding assemblies that are referenced by the <em>SitefinityWebApp</em>. In each of the assemblies, the views have their <strong>Build</strong> action set to <em>Embedded resource</em>. This way all views are included in the assemblies. This is the final place where Sitefinity CMS searches to resolve the widget view.

</td>
</tr>
</tbody>
</table>

## 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.
