Image galleries are fun; there is plenty of scripts, code out in the wild wide web for free download. A very nice script(s) is lightbox. But the problem is that it doesn’t play nice with joomla a free content management system. A content management system is just an easy way to manage content on a page. So you don’t need to be a programmer to make updates, etc. I will later write down a detailed article on what is a content management system.
So on to the problem. Joomla loads some script by defaults that enable some kool things mostly on the backend( the part used by the people in charge to add pages, etc). Regular users can’t access this part. Any who. It loads two scripts; mootools.js and caption.js.
But to use the lightbox script the mootools.js causes problems. At least that was my diagnosis. So I needed to disable mootools.js to get the scripts in lightbox to work properly. So of course no need to re-event the wheel, a quicked google searched returned this post. The script to remove the scripts(mootool.js and caption.js) worked fine, except that it also disabled another plugin I was using to include the custom gallery scripts into a page(article). I didn’t want to include the gallery code in every page since only one page will have a gallery so I download the Joomla plugin toheader. Here is a good post about it. Toheader allows you to put custom code the head section of pages.
So far I was able to remove the mootools.js and caption.js files from being loaded, but it also broke the toheader plugin since it just deleted any dynamic information that could be written to the head section of the page. Only the head section from the template was there. So I now had another problem. So I decided just to remove the mootools.js from loading and nothing else. This should keep the toheader plugin working. So luckily the remove mootools.js post linked to above had code to do just that. So that is what I did and everything worked out fine. yay!
So now I have a page(article) that loads specific head code to that page to make a gallery. None of the others pages load that code since they don’t need it. But since I removed the mootools.js from the template file if I ever need something that depends on that script I will run in to trouble, but meanwhile all is ok.
Tags: joomla gallery, lightbox and mootools.js, lightbox in joomla, remove mootools from joomla, toheader plugin


great article. i really like it. keep it up
Dot Techno Lab