Get Sugar CSS and JS in your files

sugarcrmdevelopers —  April 25, 2011

Editor’s Note: This post comes from the blog of Sugar Community member Milos Miric, who posts this great tip on pulling in all the CSS and Javascript includes from the current theme into your Smarty template.


Hey all, how many times have you made some php/html/smarty template files and been wondering how to get SugarCRM CSS and JS in it. Well here is the solution for you:



* @author Milos Miric aka eitrix @

$themeObject = SugarThemeRegistry::current();
// get css
$css = $themeObject->getCSS();

// get JS
$js = $themeObject->getJS();

// assign smarty variables


Inside smarty template do:


to get your css and js stuff printed out in page code