Search code examples
c#telerikdashboardsitefinity

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.


Solution

  • 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