Javascript library include
Permalink 1 user found helpful
I placed the hoverIntent in my themes folder and into a Js folder within that.
<script src="<?php echo $this->getThemePath()?>/js/jquery.hoverIntent.min.js"></script>
Remember JQuery is included already so just call in the hoverIntent don't recall jquery otherwise things will break.
Doesn't this then make the block dependent on the theme? It seems like there's not a strong enough separation between the block and the theme. If I change themes then my block breaks. I'm coming from Drupal and trying to find out the best practices for C5.
From you controller you can add,
$this->addHeaderItem($html->javascript('location.js'));
which requires the JS to be in the root/js
or within a Package
$this->addHeaderItem($html->javascript('location.js'), 'pkghandle');
If your in a block, add a JS folder then add the js in there and it will auto include.
--A condensed version from here
http://www.concrete5.org/community/forums/customizing_c5/adding-jav...
In concrete/libaries/view.php
There is the function, getHeaderItems, you might be able to grab that loop over the result checking if the HoverIntent is found within there if not then add the js?