Difference between revisions of "What is the purpose of the templateDetails.xml file?"

From Joomla! Documentation

(add template faq category)
m (noinclude tags)
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RightTOC}}
+
{{page|needs version update}}<noinclude>{{RightTOC}}</noinclude>
 
The templateDetails.xml file holds a variety of meta-data used by the [[Screen.templates.15|Template Manager]] in installation and maintenance. It is helpful to recognize the different sections of the file.  Typically, each section of data is indented to make the file more readable, but this indentation is not necessary.  
 
The templateDetails.xml file holds a variety of meta-data used by the [[Screen.templates.15|Template Manager]] in installation and maintenance. It is helpful to recognize the different sections of the file.  Typically, each section of data is indented to make the file more readable, but this indentation is not necessary.  
  
Line 7: Line 7:
 
[[Image:template_details_basic.png]]
 
[[Image:template_details_basic.png]]
  
<pre>
+
 
 +
<source lang="xml">
 
<install version="1.5" type="template">
 
<install version="1.5" type="template">
 
     <name>rhuk_milkyway</name>
 
     <name>rhuk_milkyway</name>
Line 18: Line 19:
 
     <version>1.0.2</version>
 
     <version>1.0.2</version>
 
     <description>TPL_RHUK_MILKYWAY</description>
 
     <description>TPL_RHUK_MILKYWAY</description>
</pre>
+
</source>
 +
 
  
 
===File Structure===
 
===File Structure===
Line 25: Line 27:
 
A small portion of the files listed in the rhuk_milkyway template is given below.
 
A small portion of the files listed in the rhuk_milkyway template is given below.
  
<pre>
+
<source lang="xml">
 
     <files>
 
     <files>
 
<filename>index.php</filename>
 
<filename>index.php</filename>
Line 34: Line 36:
 
<filename>images/indent1.png</filename>
 
<filename>images/indent1.png</filename>
 
     </files>
 
     </files>
</pre>
+
</source>
 +
 
 +
Optional and highly recommended file structure --
 +
 
 +
 
 +
<source lang="xml">
 +
<files>
 +
<filename>index.php</filename>
 +
<filename>component.php</filename>
 +
<filename>templateDetails.xml</filename>
 +
<filename>template_thumbnail.png</filename>
 +
<filename>params.ini</filename>
 +
<folder>images/</folder>
 +
        <folder>css/</folder>
 +
    </files>
 +
</source>
  
 
===Languages===
 
===Languages===
 
Some templates may include language files to allow translation of static text in the template.  Notice that two language files are shown below.  The first holds the language file for text that will be viewed by the User.  The second, placed within <administration> tags, is for text that will be viewed by the Administrator.
 
Some templates may include language files to allow translation of static text in the template.  Notice that two language files are shown below.  The first holds the language file for text that will be viewed by the User.  The second, placed within <administration> tags, is for text that will be viewed by the Administrator.
  
<pre>
+
 
    <languages>
+
<source lang="xml">
 +
<languages>
 
<language tag="en-GB">en-GB.tpl_beez.ini</language>
 
<language tag="en-GB">en-GB.tpl_beez.ini</language>
 
     </languages>
 
     </languages>
Line 48: Line 66:
 
</languages>
 
</languages>
 
     </administration>
 
     </administration>
</pre>
+
</source>
  
 
===Module Positions===
 
===Module Positions===
 
The available [[module_positions|Module Positions]] that can be used in the template are defined.
 
The available [[module_positions|Module Positions]] that can be used in the template are defined.
  
<pre>
+
<source lang="xml">
 
     <positions>
 
     <positions>
 
<position>breadcrumb</position>
 
<position>breadcrumb</position>
Line 67: Line 85:
 
<position>syndicate</position>
 
<position>syndicate</position>
 
     </positions>
 
     </positions>
</pre>
+
</source>
  
 
===Parameters===
 
===Parameters===
Line 76: Line 94:
 
An example of adding a parameter and its values is shown below.
 
An example of adding a parameter and its values is shown below.
  
<pre>
+
<source lang="xml">
 
     <params>
 
     <params>
 
<param name="colorVariation" type="list" default="white" label="Color Variation" description="Color variation to use">
 
<param name="colorVariation" type="list" default="white" label="Color Variation" description="Color variation to use">
Line 87: Line 105:
 
</param>
 
</param>
 
     </params>
 
     </params>
</pre>
+
</source>
  
 
For more information about working with Parameters, see:
 
For more information about working with Parameters, see:
Line 94: Line 112:
 
: [[Retrieving parameter data in a template file]]
 
: [[Retrieving parameter data in a template file]]
  
<noinclude>[[Category:Templates]][[Category:Topics]][[Category:Beginners]]
+
<noinclude>
[[Category:Parameters]]
+
[[Category:Template Development]]
[[Category:Template FAQ]]
+
[[Category:Template Development FAQ]]
 
</noinclude>
 
</noinclude>

Revision as of 01:00, 22 June 2013

Copyedit.png
This Article Needs Your Help

This article is tagged because it NEEDS VERSION UPDATE. You can help the Joomla! Documentation Wiki by contributing to it.
More pages that need help similar to this one are here. NOTE-If you feel the need is satistified, please remove this notice.

The templateDetails.xml file holds a variety of meta-data used by the Template Manager in installation and maintenance. It is helpful to recognize the different sections of the file. Typically, each section of data is indented to make the file more readable, but this indentation is not necessary.

Basic Details[edit]

The initial display of the Template Manager shows a list of available templates and basic details relating to the template. Each of these bits of information is gathered from the templateDetails.xml file.

File:Template details basic.png


<install version="1.5" type="template">
    <name>rhuk_milkyway</name>
    <creationDate>11/20/06</creationDate>
    <author>Andy Miller</author>
    <authorEmail>rhuk@rockettheme.com.com</authorEmail>
    <authorUrl>http://www.rockettheme.com</authorUrl>
    <copyright></copyright>
    <license>GNU/GPL</license>
    <version>1.0.2</version>
    <description>TPL_RHUK_MILKYWAY</description>


File Structure[edit]

All files related to the template are listed. Each filename contains full path information starting at the template root. The Administrator's Installer uses this information when storing the files during installation.

A small portion of the files listed in the rhuk_milkyway template is given below.

    <files>
	<filename>index.php</filename>
	<filename>templateDetails.xml</filename>
	<filename>template_thumbnail.png</filename>
	<filename>params.ini</filename>
	<filename>images/arrow.png</filename>
	<filename>images/indent1.png</filename>
    </files>

Optional and highly recommended file structure --


<files>
	<filename>index.php</filename>
	<filename>component.php</filename>
	<filename>templateDetails.xml</filename>
	<filename>template_thumbnail.png</filename>
	<filename>params.ini</filename>
	<folder>images/</folder>
        <folder>css/</folder>
    </files>

Languages[edit]

Some templates may include language files to allow translation of static text in the template. Notice that two language files are shown below. The first holds the language file for text that will be viewed by the User. The second, placed within <administration> tags, is for text that will be viewed by the Administrator.


<languages>
	<language tag="en-GB">en-GB.tpl_beez.ini</language>
    </languages>
    <administration>
	<languages folder="admin">
	    <language tag="en-GB">en-GB.tpl_beez.ini</language>
	</languages>
    </administration>

Module Positions[edit]

The available Module Positions that can be used in the template are defined.

    <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>
	<position>debug</position>
	<position>syndicate</position>
    </positions>

Parameters[edit]

A template may offer display options that can be chosen by the Administrator in the Template Manager. For instance, the rhuk_milkyway template allows the Administrator to change the border colors, change the background color, and define the display width.

File:Template details params.png

An example of adding a parameter and its values is shown below.

    <params>
	<param name="colorVariation" type="list" default="white" label="Color Variation" description="Color variation to use">
	    <option value="blue">Blue</option>
	    <option value="red">Red</option>
	    <option value="green">Green</option>
	    <option value="orange">Orange</option>
	    <option value="black">Black</option>
	    <option value="white">White</option>
	</param>
    </params>

For more information about working with Parameters, see:

Defining a parameter in templateDetails.xml
Retrieving parameter data in a template file