Thursday, November 26, 2015

REMOVING UNNECESSARY CODE IN YOUR JOOMLA – TEMPLATE

To remove code from head
$doc = JFactory::getDocument();  
unset($this->_scripts[JURI::root(true).'/media/system/js/mootools-core.js']);
unset($this->_scripts[JURI::root(true).'/media/jui/js/jquery-migrate.min.js']);
unset($this->_scripts[JURI::root(true).'/media/jui/js/jquery-noconflict.js']); 
unset($this->_scripts[JURI::root(true).'/media/system/js/caption.js']); unset($this->_scripts[JURI::root(true).'/media/system/js/core.js']); unset($this->_scripts[JURI::root(true).'/media/system/js/tabs-state.js']); unset($this->_scripts[JURI::root(true).'/includes/js/joomla.javascript.js']);

if (!empty($this->_script['text/javascript'])){
unset($this->_script['text/javascript']);
}