Removing mootools-core.js and caption.js from Joomla
So when I create a basic content page using an article layout with no modules I am surprised to see these 3 lines
This happens on both joomla 1.5 and 1.6 When I looked around the web for a solution I keep finding the answer to be use regular expression on the final output to remove it. While this will remove it, I wanted to understand why this is added. It should in theory only be added when it is needed. If I add a module that does need mootools then I do not want to be removing the script file.
It will break the module. Not being a core hack is probably the only good thing about this method. Since Joomla will only add files that are told to be included, so I decided to work out why they were being told to be included when nothing on the page needs them.
Digging in to why, this is what I found: In the com_content component it is calling
How to fix
All you need to do is comment out a line in a core component com_content. This is a core hack any update will revert this change and you will have to manually update it. ok on to the fix.
In the file: “/components/com_content/controller.php” find: “public function display($cachable = false, $urlparams = false)” we just comment out:
so it will become
Add a comment below if this worked for you or you had any problems implementing this hack.