Table of Contents Previous Next

Sugar Developer Guide

Version 5.1


Chapter 2 Application Framework : Sugar Dashlets : Sugar Dashlet Files

Sugar Dashlet Files
The file name containing the main Sugar Dashlet code must match the Sugar Dashlet’s class name. For example, the Sugar Dashlet class JotPadDashlet will be found in the file /Home/Dashlets/JotPadDashlet/JotPadDashlet.php. The JotPadDashlet Dashlet is a sample Sugar Dashlet released originally in Sugar 4.5. It serves as a useful example from which to begin your development efforts.
A metadata file accompanies each Sugar Dashlet. It contains descriptive information about the Sugar Dashlet as defined here:
$DashletMeta['JotPadDashlet'] = array(
'title' => 'LBL_TITLE',
'description' => 'LBL_TITLE',
'icon' => 'themes/Sugar/images/Accounts.gif',
'category' => 'Tools');

The naming convention for the metadata file is
className.meta.php, where className is the name of your Sugar Dashlet, and it must appear in the same directory as the Sugar Dashlet code. For JotPadDashlet the meta file is stored in /Dashletsmodules/Home/Dashlets/JotPadDashlet/JotPadDashlet.meta.php.
The ‘title’ and ‘description’ elements are translated. If the values here match a key in the array $DashletStrings (from the language file) then they will be translated otherwise it will display the literal string. (It is best practice to use translatable language strings so that your Sugar Dashlet is international!)
Language files have a similar naming convention: className.locale.lang.php (e.g., /Dashletsmodules/Home/Dashlets/JotPadDashlet/JotpadDashlet.en_us.lang.php )
Icon files can either be defined in the .meta data file or simply included in the Sugar Dashlet Directory (e.g., /Dashletsmodules/Home/Dashlets/JotPadDashlet/JotPadDashlet.icon.png). The system will scan for image files in the corresponding Sugar Dashlet directory.

Table of Contents Previous Next

Copyright 2004-2008 SugarCRM Inc.
Product License