Datareign

Joomla is not a single application but an amalgamation of several technologies. This is, of course, true of much modern software.

In Joomla, understanding the way in which the various technologies interact will be very helpfull in building and maintaining reliable websites. As the various components within Joomla interact with their underlying technologies, data passes back and forth. These data flows are what Joomla is mainly concerned with.

How Joomla Works

Joomla is, mainly, a collection of PHP scripts. These scripts cause PHP to interact with an Apache webserver and a MySQL database.

In essence, data from MySQL is formatted according to one or more templates and then served by Apache to a requesting browser. The following diagram indicates this graphically:

You should be aware that Microsoft's Internet Information Server (IIS) may be used in place of Apache on a Windows host and it can be argued that IIS offers certain performance and security advantages over Apache. Agaist this, Joomla is developed mainly against Apache, so it may work better in that environment. The differences are, in any case, likely to be outweighed by other factors, such as the pre-existence of sites based on one or other of these servers.

Template Structure

Joomla is a presentation engine; it's the templates that define how it will show information to the visitor. Templates may be a simple or as complex as is required.

index.php

This is the site initialiser and is the only file that Joomla insists is present. Most modern browsers will run this automatically, when opening the site, provided that it is in the document root and that no index.html file is present. More details are in Joomla index.php

Optional Files

There are various files that you can add to index.php in order to make a template more flexible or just plain prettier…

  • template.css describes the fonts, colours and other presentation definitions. See Joomla template.css for more details.
  • templateDetails.xml holds the metadata for the template. Its main purpose is to document the template but it also holds details of any parameters that may be changed via the Administrator Interface.
  • banner.jpg is the default banner image for the site. The image may be of any type that a standard browser can display and the file extension will thus be “gif”, “jpg”, “png”, etc., as appropriate.
  • parameters.ini
  • template_thumbnail.png

Template Directories

Each template is stored within a dedicated directory. It's common but not mandatory, for this directory to contain sub-directories and for the basic files layout to look something like this…

 templates/
          |
          MyTemplate/                   index.php and basic support files
                    |
                     ----css/           template.css + any additional format files
                    |
                     ----html/          core output override files
                    |
                     ----images/        template images, especially banner.xxx
                    |
                     ----javascript/    java code that the template calls.

Template Installation

Provided a template conforms to the above rules and advice, simply copying its directory into the templates directory is sufficient to make it available for immediate use.

The normal practice for distributing templates, then, is to pack them into either a .zip file or a Unix tarball, so that any directory structure is maintained. Either type of file is then simply unpacked under the templates path, completing the installation.

Last modified: 2009/01/21 16:52