Selectively load Javascript c5 ver 5.6

Permalink
Hi,

I am theming using ver 5.6 and would like to selectively load css and js that is load certain js script & file and css only on certain page or page types.

Can anybuddy tell me how to achieve this the correct way.

Thanks
dk

 
hutman replied on at Permalink Reply
hutman
You can do something like this in the on_start function of your page type controller

$html = Loader::helper('html');
$this->addHeaderItem($html->javascript('jquery.ui.js'));
$this->addHeaderItem($html->css('jquery.ui.css'));

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.