I am trying to convert a program I wrote some time ago to a mod for PostNuke.
I need to add aditional javascript that is generated from the mod.
I looked at header.php and there is a $additional_header variable. But when I set this in my mod it does not add the javascript. I can get it to echo from the mod itself but not where I need it in the header.
Hope someone can give me a little advice
Login
Donate to Zikula
Core Modules & Blocks
::
How to add additional header.php info from mod?
-
-
Try setting global $additional_header; and make sure you assign a value to $additional_header before you include header.php.
-Shawn -
Tried that already and it did not work.
Been working on it for too long now!
Thanks -
Ok in header.php I changed
if(isset($additional_header))
{
echo @implode("\n", $additional_header);
}
to
if(isset($additional_header))
{
echo $additional_header;
}
It works now but I am trying to get it to work without making changes to any of the core files. -
Figured it out.
instead of using
$additional_header = "this is all my javascript code";
I had to use
$additional_header[] = "this is all my javascript code";
the code in header.php is looking for an array when using echo @implode("\n", $additional_header);
Hope others can use this -
