# Configure custom widgets to support content locations

To configure your custom widget to support content locations, you must mark the widget with the following property:\
`[SitefinityWidget(IsContentLocation = true)]`

> success **GITHUB EXAMPLE**: You can see an example of how to use this property in Sitefinity GitHub Repository » [ContentListViewComponent.cs](https://github.com/Sitefinity/sitefinity-aspnetcore-mvc-widgets/blob/master/Progress.Sitefinity.AspNetCore.Widgets/ViewComponents/ContentListViewComponent.cs#L16).

To support the content locations functionality, in the widget, you should also provide the following properties via the `Entity` object :

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

<strong>Property</strong>

</td>
<td>

<strong>Description</strong>

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

<p><code>SelectedItems</code><br>
(<em>Required</em>)</p>

</td>
<td>

Holds the selected items.<br>

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

<p><code>ContentViewDisplayMode</code><br>
(<em>Optional</em>)</p>

</td>
<td>

<p>Determines the behavior of the widget. It can be one of the following:</p>
<ul>
<li><code>Automatic</code> - Automatically determines whether to render the items in list mode or detail mode. <br>
This is the default behavior.</li>
<li><code>Master</code>&nbsp;- Always displays items in list mode and does not handle additional parameters.&nbsp;</li>
<li><code>Detail</code> - Always displays items in detail mode based on the selection of the first item from the manually selected items.&nbsp;<br>
</li>
</ul>

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

<p><code>DetailPageSelectionMode</code> (<em>Optional</em>)</p>

</td>
<td>

<p>Determines how to open the detail mode of content items inside the content widget:</p>
<ul>
<li><code>SamePage</code> - Opens the detail item in the same page.</li>
<li><code>ExistingPage</code> - Opens the detail item in another existing page.<br>
Requires property <code>DetailPage</code>&nbsp;to be present.&nbsp;</li>
</ul>

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

<p><code>DetailPage</code><br>
(<em>Required, if </em><code>ExistingPage</code><em> is selected</em>)</p>

</td>
<td>

When you have chosen to open the detail mode of an item in another existing page, this property gets the details page. <br>

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

The following sample demonstrates how to use the above properties:

```C#
// SelectedItems property

[Content] 
public MixedContentContext SelectedItems { get; set; } 

// ContentViewDisplayMode propery

public ContentViewDisplayMode ContentViewDisplayMode { get; set; } 

// DetailPageSelectionMode property

[DataType(customDataType: KnownFieldTypes.RadioChoice)] 
public DetailPageSelectionMode DetailPageMode { get; set; } 

// DetailPage property

[Content(Type = KnownContentTypes.Pages, AllowMultipleItemsSelection = false)] 
[ConditionalVisibility("{\"conditions\":[{\"fieldName\":\"DetailPageMode\",\"operator\":\"Equals\",\"value\":\"ExistingPage\"}],\"inline\":\"true\"}")] 
public MixedContentContext DetailPage { get; set; } 
```
