H S
H S

Reputation: 103

Is it possible to create a custom widget on the Sitefinity 10 dashboard?

I was wondering whether it is possible to create a custom widget on the Sitefinity 10 dashboard.

I have tried to add a widget from the 'Configure Dashboard widgets' section.

I can get a dashboard widget that lists all my dynamic module items. But I need a way to filter these down further by their custom property 'ReviewDate' (DateTime) whilst still retaining the out of the box functionality associated with dashboard widgets (for example the paging, direct inline edit links), I can't get access to this property from the dashboard service, it only returns generic properties such as title, published date etc.

Is there an alternative way to achieve the above?

I could not find any reliable source, so not sure... Any help would be appreciated, thank you.

Upvotes: 1

Views: 656

Answers (2)

Ivan Eftimov
Ivan Eftimov

Reputation: 228

You can change the filter expression of the dynamic content widget, through the Advnaced widget settings. If you use the MVC widget, you can find this setting under Advanced > Model: enter image description here

If you are using the WebForms widget, the same setting is burried under several layers of settings: enter image description here

More details about filter expressions: http://docs.sitefinity.com/filter-expressions-for-content-items

Upvotes: 0

Victor Leontyev
Victor Leontyev

Reputation: 8736

Dashboard widgets, it is the same as front-end widgets. All what you need to do is:

  1. Create controller
  2. Add attribute [ControllerToolboxItem(Name = "Dashboard Sample", Title = "Dashboard Sample", SectionName = "Custom (Administration)")]
  3. Add view for your widget:

<div class="sfDashboardWidgetWrp"> <h2 class="sfBlack">Widget name </h2> <div class="dataWrapper"> <!-- ENTER YOUR MARKUP HERE--> </div>
</div>

  1. Open \App_Data\Sitefinity\Configuration\ToolboxesConfig.config. Find <add enabled="True" title="Custom (Administration)" ordinal="0" name="Custom (Administration)"> and add tags="backend". It should be like that <add enabled="True" title="Custom (Administration)" ordinal="0" name="Custom (Administration)" tags="backend">

After that, if you will go to Configure Dashboard widgets, you will find section with your widget: enter image description here

Upvotes: 1

Related Questions