# Naming conventions

When working with MVC-based widgets and templates, you create and manage files of specific types and store them in a specific location in your project. You follow naming conventions that define how Sitefinity CMS prioritizes and resolves views and assets like scripts, for example.

## Designer views

The following table summarizes how you name your files and where you store them:

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

<strong>File type</strong>

</td>
<td>

<strong>Convention</strong>

</td>
<td>

<strong>Location of file</strong>

</td>
<td>

<strong>Description </strong>

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

<p>Designer view</p>
<p>For example, you are creating a designer view, named <em>Custom</em>, for a <em>News</em> widget.</p>

</td>
<td>

`DesignerView.Custom.cshtml`

</td>
<td>

`~/MVC/Views/News/Custom`

</td>
<td>

A template for the custom view in the widget designer.

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

Designer view for dynamic content widget

</td>
<td>

`DesignerView.Custom.cshtml`

</td>
<td>

<span class="Code">\~/Mvc/Views/\<DynamicContentTypeName>/Custom</span>

</td>
<td>

A template for the custom view of a dynamic content type widget. `<DynamicContentTypeName>` is the name of the dynamic content type, for example `Country`. If you created a dynamic type with name *Countries*, the folder name must still e named with singular form.

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

JSON configuration

</td>
<td>

`DesignerView.Custom.json`

</td>
<td>

`~/MVC/Views/News/Custom`

</td>
<td>

A `JSON` file that defines a set of additional scripts (and their dependencies), required by the designer view, to be rendered.

Has the same name as the view template.

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

Script

</td>
<td>

`designerview-custom.js`

</td>
<td rowspan="2">

`~/MVC/Scripts/News/Custom`

`designerview-custom.js` containing AngularJS controller named `CustomCtrl`.

</td>
<td>

A JavaScript file with custom client-side logic. Needs to be in the same location as the custom view, so that it overrides the default script file.

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

Angular controller

</td>
<td>

`CustomCtrl`

</td>
<td>

The controller that handles the populating and saving of widget properties through the designer.

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

In addition, Sitefinity CMS follows a strict convention for resolving views for widgets, based on where the view files are located. For details, see [Priorities for resolving views](https://www.progress.com/documentation/sitefinity-cms/priorities-for-resolving-views-mvc).

## Frontend views

The following table summarizes the naming conventions of frontend views of MVC widget types.

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

<strong>Widget type</strong>

</td>
<td>

<strong>Convention</strong>

</td>
<td>

<strong>Location of file</strong>

</td>
<td>

<strong>Description</strong>

</td>
</tr>
<tr>
<td rowspan="2">

<p>Widgets with <em>List</em> and <em>Detail</em> views:</p>
<ul>
<li>Blog</li>
<li>Blog post</li>
<li>Document</li>
<li>Event</li>
<li>Event Scheduler</li>
<li>Image gallery</li>
<li>Lists</li>
<li>News</li>
<li>Users list</li>
<li>Video gallery</li>
</ul>
<p>This list also includes any dynamic content widget.</p>

</td>
<td>

<span class="Code">List.<em>ViewName</em>.cshtml</span>

</td>
<td rowspan="2">

<span class="Code">\~/Mvc/Views/<em>ControllerName</em></span>

<br>
<span class="Code">~/Mvc/Views/&lt;<em>DynamicContentTypeName</em>&gt;</span>

</td>
<td rowspan="2">

<p>You need to use the view name.</p>
<p>When working with dynamic content widgets, the name of the folder must <strong>correspond</strong> to the name of the content type.</p>

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

<span class="Code">Detail.<em>ViewName</em>.cshtml</span>

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

* Account activation
* Card
* Change password
* Comments
* Comments count
* Feed
* Flat taxonomy
* Form
* Hierarchical taxonomy
* Language selector
* Login form
* Login status
* Navigation
* Registration
* Reviews
* Reviews count
* Site selector
* Subscribe form
* Unsubscribe form
* Video

</td>
<td>

`NavigationView.Horizontal.cshtml`

</td>
<td>

<span class="Code">\~/Mvc/Views/<em>ControllerName</em></span>

</td>
<td>

In the example, `Horizontal` is a unique template name that will be displayed in the *Templates* dropdown menu. You can replace the name with one that suits your needs.

The custom view must be placed in a folder that corresponds to the controller name (without the Controller suffix).

> important **IMPORTANT**: You need to have the `NavigationView` in the beginning of your view name, so that the template is associated with the *Navigation* widget.

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

* Breadcrumb
* Content pager
* Document link
* Image
* Search box
* Search results

</td>
<td>

`Breadcrumb.cshtml`

</td>
<td>

<span class="Code">\~/Mvc/Views/<em>ControllerName</em></span>

<br>
</td>
<td>

You can name the view `.cshtml` file according to your preferences.

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

* Captcha
* Checkboxes
* Dropdown list
* File field
* Hidden field
* Navigation field
* Multiple choice
* Page break
* Paragraph text
* Section header
* Submit button
* Text field

</td>
<td>

<p><span class="Code">Write.&lt;NameOfTemplate&gt;.cshtml</span></p>
<p><span class="Code">Read.&lt;NameOfTemplate&gt;.cshtml</span></p>

</td>
<td>

<span class="Code">\~/Mvc/Views/\<NameOfWidget></span>

</td>
<td>

<p>Substitute <span class="Code">&lt;NameOfTemplate&gt;</span> with a name of your choice.</p>
<p>Most of these fields are dropped in form editor and are therefore referred to as form fields.</p>

> important **IMPORTANT**: The form editor is package agnostic, you need to place the new widget templates in the root of your project `~/Mvc/Views/<NameOfWidget>`. 

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

Content block

</td>
<td>

`Default.cshtml`

</td>
<td>

<span class="Code">\~/Mvc/Views/<em>ControllerName</em></span>

</td>
<td>The <em>Content block</em> has specifics that require the name of the file to be `Default`, because the `ContentBlockController` renders a view named `Default`.</td>
</tr>
</tbody>
</table>
