Developer forum

Forum » CMS - Standard features » Custom dashboard widgets

Custom dashboard widgets

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I can think of a ton of cool things you can do with the new dashboards. Are they based on an extensible model? In other words, can I create my own? Any guidance on how to do that would be great.

Thanks,

Imar


Replies

 
Martin Vang
Martin Vang
Reply
This post has been marked as an answer

Hi Imar,

There is (sadly) not alot of documentation for the dashboards (yet). It is planned for documentation.

Yes, you can create your own dashboard widget - that is actually going to be a talk for summit. All the current dashboards in DW9 are provider-based, so taking a look at them should get you started. Fx. ChartWidget:

[AddInName("Latest visits")]
[AddInDescription("Show the latest visits in the solution")]
[AddInIcon(KnownIcon.ViewStream)]
public class LatestVisitsWidget : ListWidget
{
    public LatestVisitsWidget()
    {
        Title = Translate.Translate("Latest visits");
    }

    public override IEnumerable<ListViewItem> GetItems(IDashboard dashboard, string path)
    {
        var pageService = ServiceLocator.Current.GetPageService();
        var result = new List<ListViewItem>();
        int maxCount = 6;
        var cb = CommandBuilder.Create($"SELECT TOP {maxCount} * FROM [Statv2Session] WHERE [Statv2SessionIsLead] IS NULL ORDER BY [Statv2SessionTimestampEnd] DESC");
        [...]
        return result;
    }
}

I hope this will satisfy you for now. There will be more at Summit! :)

BR

Martin

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Excellent, thanks Martin. That should get me started. Looking forward to seeing more about this at the summit.

Imar

 
Dynamicweb Employee
Carsten Boll
Reply

Hi - for anyone else looking we do have a user-oriented documentation for dashboards ready -  but nothing on extensibility just yet, I am afraid.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Any plans to add new documentation for the extensibility parts? Would be nice to have a getting starting guide for developers new to the widget framework....

 
Dynamicweb Employee
Carsten Boll
Reply

No. I mean, it's the ambition, yes, but nothing concrete is in the works atm.

But duly noted :)

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

;-) Thanks!

 
Dynamicweb Employee
Carsten Boll
Reply
This post has been marked as an answer

Hi Imar & others - we've put together an article on creating custom widgets & custom dashboards: http://doc.dynamicweb.com/extensibility/extending/custom-dashboards 

Votes for this answer: 2
 
Tobias Høst
Reply

Anything new on dashboards? The two links in the thread does not work any more :(

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Tobias,

Is this what you are looking for? https://doc.dynamicweb.com/extensibility/extensibility/custom-dashboards

 

You must be logged in to post in the forum