Reputation: 103
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
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:
If you are using the WebForms widget, the same setting is burried under several layers of settings:
More details about filter expressions: http://docs.sitefinity.com/filter-expressions-for-content-items
Upvotes: 0
Reputation: 8736
Dashboard widgets, it is the same as front-end widgets. All what you need to do is:
[ControllerToolboxItem(Name = "Dashboard Sample", Title = "Dashboard Sample", SectionName = "Custom (Administration)")]
<div class="sfDashboardWidgetWrp"> <h2 class="sfBlack">Widget name </h2> <div class="dataWrapper"> <!-- ENTER YOUR MARKUP HERE--> </div>
</div>
\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:
Upvotes: 1