Due to the programming of Joomla, creating a template to control the styling and layout of your template can be something that may become necessary as you progress along the journey of your own Joomla site, this is the moment before frustration begins. As controlling the many factors of a Joomla template in no easy feat at first, a Joomla template consists of an xml file containing the installation instructions. A CSS styling sheet to handle the styling of all the objects, divs, forms etc. and finally the file.
There are many other files that may be used in for the template but the above list displays the core files needed when creating a Joomla template. Now to discuss how I would generally start the programming of a template.
I begin with the XML file as this is the file that will need to contain the instructions for Joomla to install the file, this files can become a stock standard copy and paste for the templates you construct, however if there any files that were used in the previous template and not in the new template you will need to remove them from the XML file or you will find a horrible error when you try to install the template in the backend of Joomla.
Starting out code:
The code below must be used at the very beginning of the template. As this is needed to validate the code used in the file.
The next section tell Joomla what it is installing.
Then come the details of the template
The templates name
The Copyright Info
The description of the Template
The next section tells Joomla what files need to be installed with the template this contains both individual files as well as folders that Joomla will install. All the files used for the template must be listed if the file is not listed Joomla will not install the file which may return an error or cause your template to malfunction.
This sections tells Joomla which positions you are using in this template, the names for the positions are completely to you. As they are controlled by the index file. So create position names you are comfortable with and you will use time and time again, however as I have grown as a programmer so has the names and amount of positions I use. The below listed positions are standard to Joomla are many programmers use specific positions for specific modules. For example user 4 is generally used for the search module.
The Final section is the parameters section, this is used to allow the backend to control certain areas of the template or alternative colors for the template. It can also be used to control the analytics insertion.
Ensure that you end the installation off with the following tag.
This is the very basics of a Templates XML file, this file contains the instructions for Joomla when installing the template to your Joomla website.
The next article will show what the basic construction of the index .php file.