The XML file of a Joomla Template is a necessary file as written on the joomla doc page:
The templateDetails.xml file is essential. Without it, your template won't be seen by Joomla!. The file holds key "metadata" about the template.
The simplest templateDetails.xml file defines the template name, template description, template files, and template positions.
Here is an example of a very basic templateDetails.xml file as found on the Joomla docs page:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD
template 1.0//EN"
"http://dev.joomla.org/xml/1.5/template-
install.dtd">
<install version="1.5" type="template">
<name>mynewtemplate</name>
<creationDate>2008-05-01</creationDate>
<author>John Doe</author>
<authorEmail>john@example.com</authorEmail>
<authorUrl>http://www.example.com</authorUrl>
<copyright>John Doe 2008</copyright>
<license>GNU/GPL</license>
<version>1.0.2</version>
<description>My New Template</description>
<files>
<filename>index.php</filename>
<filename>component.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_thumbnail.png</filename>
<filename>images/background.png</filename>
<filename>css/style.css</filename>
</files>
<positions>
<position>breadcrumb</position>
<position>left</position>
<position>right</position>
<position>top</position>
<position>user1</position>
<position>user2</position>
<position>user3</position>
<position>user4</position>
<position>footer</position>
</positions>
</install>
This templateDetails.xml< file defines all the legal and copyright elements, files associated with the template and joomla module positions.
Joomla has a very useful ability to allow editing of HTML and CSS files from the administrator back-end, so be sure to declare them in the templateDetails.xml file.
One of the more expandable and customizable elements are module positions. For apt2labs.com I declared 12 positions:
<position>topnav</position>
<position>left_col1</position>
<position>left_col2</position>
<position>syndicate_rt1</position>
<position>search_rt2</position>
<position>feature_rt3</position>
<position>category_rt4</position>
<position>login_rt5</position>
<position>user1</position>
<position>user2</position>
<position>user3</position>
<position>footer</position>
The templateDetails.xml file is also used to declare parameters relating to the template. For example, the background color of the web page, column widths, can all be declared and then defined by the user in the administrator back-end. For apt2labs.com we did not define any of these kinds of parameters.
Next Post: How to call Joomla documents (jdoc statements) and modules and where to insert them
How have you used XML to pump-up the customization of a template or website?