Adding javascript to head of Joomla website -
i have gone through joomla tutorials , not understanding how joomla works. have never encountered every aspect of evades me. i'm not asking free ride.. go or basic thought of how works.
i need add together panoramio javascript <head></head>
section of joomla website. in word press download header.php template , code away.
it's confusing understanding joomla. know not paste straight "article" page have install sort of extension or tool work?
i read edit index.php in templates can't find that. person can't understand joomla @ all? beginner documentation seems assume know system. give thanks in advance.
be careful files add together code to. editing core files index.php in templates folder might not best solution. if there template update? file overridden. bare in mind.
before add together script, thought name of current template:
$app = jfactory::getapplication(); $template = $app->gettemplate();
you can utilize next import .js
file <head>
tags:
$doc = jfactory::getdocument(); //only include if not included $doc->addscript(juri::root() . 'templates/' . $template . '/file.js');
or can add together javascript there , so:
$doc = jfactory::getdocument(); $js = " //javascript goes here "; $doc->addscriptdeclaration($js);
hope helps
javascript joomla
No comments:
Post a Comment