For Sugar Developers, the Dashboard and Dashlet framework provided in Sugar 7 really helps you to build slick reusable Dashlets that can be targeted for certain parts of the app or made globally available anywhere in the app. They’re also really easy to use which is something we are gonna highlight today.
For a more detailed look at how Sugar 7 Dashlets work then you should read up on the topic in the Sugar Developer Guide. The focus on this post is to highlight the most basic elements necessary that we can then build upon in later posts.
A quick reminder
Just some quick advice to anyone about to embark on the Dashlet development journey. We recently featured a post on a common Sugar 7.x dashlet gotcha. Basically, dashlet metadata gets copied into database when you add a dashlet to a dashboard. You’ll need to delete the dashlet or the dashboard and add it all over again whenever you modify dashlet metadata. We are working on making this seamless in future but this is something you should remain aware of when building dashlets.
Creating a Dashlet Summarized
Dashlets are simply Sugar 7 Views that have some extra features added via the ‘Dashlet’ plug-in and an additional metadata requirement. This tutorial will be brief because creating a basic dashlet is incredibly easy. As with any Sugar 7 view, we will need three files: a JS controller, a PHP metadata file, and a Handlebars template for the presentation.
Shall we begin?