Including header elements in an included block
Permalink
Hello,
I'm currently including sponsoren.php with this code:
Then in sponsoren.php this to get a slider from my scrapbook:
However, it's not loading the JS/CSS so I thought I'd use this:
However, this doesn't work and I can't get it working ... any suggestions?
I'm currently including sponsoren.php with this code:
<?php $this->inc('elements/sponsoren.php'); ?>
Then in sponsoren.php this to get a slider from my scrapbook:
<?php $b = Block::getByName('sponsorslider'); if (
However, it's not loading the JS/CSS so I thought I'd use this:
<?php public function on_page_view() { $html = Loader::helper('html'); $this->addHeaderItem($html->javascript('/packages/simple_image_slider/blocks/simple_image_slider/js/carousel.js')); $this->addHeaderItem($html->css('/packages/simple_image_slider/blocks/simple_image_slider/view.css')); }?>
However, this doesn't work and I can't get it working ... any suggestions?
I suggest you add the css and the javascript to your theme.
Good luck!