Recent Comments
Tags
Categories
- CMS (9)
- Design (2)
- Languages (1)
- Life (2)
- Travel (1)
- Uncategorized (2)
- Web Development (9)
- Work (6)
Many times you need to inject includes of javascript or css into the header instead of writing the include path into add.php or edit.php. This is a much cleaner solution and can be accomplished in the blocks controller.php. In this example I include both swfobject and jquery’s colorpicker libraries as well as the jquery colorpicker Concrete5 css file:
/*
* include swfobject and colorpicker in the header
*/
public function on_page_view() {
$html = Loader::helper('html');
$this->addHeaderItem($html->javascript('swfobject.js'));
$this->addHeaderItem($html->javascript('jquery.colorpicker.js'));
$this->addHeaderItem($html->css('ccm.colorpicker.css'));
}
Using the on_page_view() function easily accomplishes this.
Great sharing. I’m subscribing to your site now. Thanks
Saved me alot of frustration! Thanks!