View

Get Sugar CSS and JS in your files

by C.R. Matín on 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:  
<?php

/**
* @author Milos Miric aka eitrix @ eontek.rs
*
*/

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

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

// assign smarty variables
$this->ss->assign("SUGAR_CSS",$css);
$this->ss->assign("SUGAR_JS",$js);

?>
Inside smarty template do: {$SUGAR_CSS} {$SUGAR_JS} to get your css and js stuff printed out in page code Share

{ 0 comments }

insert footerTPL on SugarCRM views

by C.R. Matín on March 24, 2011

Editor's Note: Another blog post from Sugar Community member Milos Miric, showing how to use the footerTPL parameter on editviews and detailviews to add additional custom content to those views.

Hello everyone :) Hope you had a great time for new year and all other holidays. It’s been a while since i wrote last time because i was busy myself working on some projects and having some good times on mountain. I don’t know to ski although i do enjoy snow much. Maybe i learn one day who knows :)

Now, back on topic!

What i would like to talk about today is something that can give you extensive level of customization on editview or detailview. Inside editviewdefs or detailviewdefs there is a tag footerTPL that requires a file to be specified as value and it will try to parse the complete file as smarty template file. If you want to avoid this you can just put {literal} on start and {/literal} on end of it.

Example:

[PHP]<br /> &amp;#8216;footerTpl&amp;#8217;=>&amp;#8217;custom/modules/Accounts/tpls/accounts_footer_view.html&amp;#8217;<br /> [/PHP]

This should be inside form array in def files.

On the picture below you can see where the html will be inserted.

Footer insert point

The yellow color on picture illustrates the point where the included file will be inserted and there is basically no limitation on what you can insert. Any html you could think of can be inserted and supported with php with ajax.

Share

{ 0 comments }