Custom Code Management in Joomla! CMS

Mar 24, 2008 16:53 GMT  ·  By

Any Internet user will have a better experience by browsing an interactive website. You can make your own website more attractive by adding various applications like games, news or any other scripts that involve live interactions between the visitors and website pages. There are many free solutions to add such applications to your website, like Google Gadgets.

Google Gadgets are simple applications made with Javascript and HTML code that can be included in any website. If your website is driven by a content management system like Joomla!, Drupal or WordPress the integration of custom code into your web pages can be made directly or with specific add-ons. In the case of Joomla! CMS, many modules are available and they could be used to include various Google Gadgets into your website.

If you will select Joomla Mod PHP, it will allow you to integrate PHP, HTML, Javascript and CSS code to any available modules position inside your template. First, you must go to the Google Gadgets homepage to select the desired applications that you want to include in your website page(s). After you install Joomla Mod PHP, select its appropriate entry in the Module Manager page, paste the corresponding script for the chosen gadget and publish it in the desired free module position.

For example, if you choose Virtual Aquarium gadget and you want it to appear in the Top module position in the default rhuk_solarflare_ii template (Joomla! 1.0.x), the gadget width and height should be approximately 164 and respectively 150. After you paste the corresponding code into the appropriate field in Joomla Mod PHP, select the Position: Top (News Flash module must be unpublished) and save the changes.

Any Google Gadget could also be published as a component with a link to one of the existing menus. You must download and install M2C componentwhich allow you to display a certain module as content on a single page. In case of Joomla Mod PHP module it must be published in the m2c position. If this position does not appear in the Position drop down menu, then it must be enabled by specifying its name (m2c) in the module positions manager. (an example can be seen in the screenshot). Because a high quantity of Javascript code on one page could increase its loading time, is recommended to limit the number of gadgets or other Javascript applications on a certain webpage.