Tag Archives: Joomla

Joomla 1.5 optimisation: removing mootools.js and caption.js

Following solution allowed me to remove 74KB of useless data included by default. These scripts are useless for unregistered users, who have no need to edit articles.

It is selective removal of scripts included in joomla 1.5 by default and it leaves rest of  js  included.
The workaround I’ve seen in forums just removed all js and it caused some problems with joomgallery which required its own scripts to be pretty.:)

paste after “<jdoc:include type=”head” />” in the index.php of template:

<?php
// — remove js scripts (mootools.js and caption.js).
$user =& JFactory::getUser();
if ($user->get(‘guest’) == 1) {
$headerstuff=$this->getHeadData();
unset($headerstuff[‘scripts’][“/media/system/js/mootools.js”]);
unset($headerstuff[‘scripts’][“/media/system/js/caption.js”]);
$this->setHeadData($headerstuff);
}
?>

BTW, to remove META GENERATOR,  comment
"$strHtml .= $tab.’<meta name=”generator” content=”‘.$document->getGenerator().’” />’.$lnEnd;"
in this file:
"/libraries/joomla/document/html/renderer/head.php"