
describe further what you are trying to accomplish ... I think that would help.
<head>How do I get code here from wihtin a block</head>
tag is part of the template. Not the block. So, I would probably recommend editing the template you are using and insert the HEAD CSS/JS there.
use:
This is the method i use from within my blocks construct function, if you do not have a construct function then here's what it looks like:
hope this helps!
$this->addHeaderItem('<script src="location/of/your.js" type="text/javascript"></script>','CONTROLLER');
This is the method i use from within my blocks construct function, if you do not have a construct function then here's what it looks like:
function __construct($obj = null) { parent::__construct($obj); }
hope this helps!
new everyday. I didn't know there was such a function. Good to know.
Of course, that is assuming you are writing your own block (or extending a core block ... which would also work).
Of course, that is assuming you are writing your own block (or extending a core block ... which would also work).
I'm trying to do the same thing with a nicedit block I'm busy with :
In controller.php does it but is there no way to include the js file at the top of the head tag?
According to :
http://docs.jquery.com/Using_jQuery_with_Other_Libraries#Including_...
There is no need for overriding the $-function by calling "jQuery.noConflict()" when no jquery js files are included before any jquery js files in the head.
Adding js files that are not used with jquery to the bottom of the head tag in concrete5 by default seems very wrong because it's very jquery centric.
Also I think there is a better way in the api to do the :
bit, any thoughts/suggestions?
public function getBlockPath() { return t("/concrete/packages/nicedit/blocks/nicedit"); } public function __construct($obj = null) { parent::__construct($obj); $niceditjs = ($this->getBlockPath() . ('/nicEdit.js')); $html = Loader::helper('html'); $this->addHeaderItem($html->javascript($niceditjs)); }
In controller.php does it but is there no way to include the js file at the top of the head tag?
According to :
http://docs.jquery.com/Using_jQuery_with_Other_Libraries#Including_...
There is no need for overriding the $-function by calling "jQuery.noConflict()" when no jquery js files are included before any jquery js files in the head.
Adding js files that are not used with jquery to the bottom of the head tag in concrete5 by default seems very wrong because it's very jquery centric.
Also I think there is a better way in the api to do the :
public function getBlockPath() { return t("/concrete/packages/nicedit/blocks/nicedit"); }
bit, any thoughts/suggestions?
Following the discussion by:
http://www.concrete5.org/index.php?cID=11369...
The preceding discussion is the:
http://www.concrete5.org/index.php?cID=8436...
http://www.concrete5.org/index.php?cID=11369...
The preceding discussion is the:
http://www.concrete5.org/index.php?cID=8436...