addHeaderItem from block
Permalink
I have an element to load lightview:
I call it with Loader::Element('lightview');
When using this on a single page it works as expected, but when using it from a block that needs it nothing happens.
Why? Am i doing something wrong? Is it not possible to add header items from a block?
<?php defined('C5_EXECUTE') or die("Access Denied."); $html = Loader::helper('html'); $v = View::getInstance(); $lightview = '<!--[if lt IE 9]>'; $lightview .= $html->javascript('excanvas/excanvas.js'); $lightview .= '<![endif]-->'; $lightview .= $html->javascript('spinners/spinners.js'); $lightview .= $html->javascript('lightview/lightview.js'); $lightview .= $html->css('lightview/lightview.css'); $v->addHeaderItem($lightview);
I call it with Loader::Element('lightview');
When using this on a single page it works as expected, but when using it from a block that needs it nothing happens.
Why? Am i doing something wrong? Is it not possible to add header items from a block?
Mike