![]() |
Languages: |
English |
[path-to-Joomla]/templates/beez/templateDetails.xml
Note that letter case is important on case-sensitive operating systems such as Linux. You can use a standard text editor (not a word processor) or an XML editor to make changes to this file.
Locate the <params> element, generally towards the end of the file. If there is no <params> element you will need to add one. This must be immediately beneath the <install> element in the XML element hierarchy. Don't forget to close the element with a </params> tag. Note that for Joomla 1.6 onwards the <install> tag is deprecated in favour of <extension>.
For each parameter that you want to define, add a <param> element. This element takes a number of mandatory and optional arguments that depend on the type argument. The only truly mandatory argument is type, but name, default, description and label are common to most parameter types and name is mandatory whenever it occurs. These mandatory/common arguments are:
The following arguments are optional but are common to almost all parameter types:
The optional arguments depend on the parameter type. Each of the parameter types is described in detail in J1.5:Standard parameter types. If you are a developer it is also possible to create your own custom parameter types; see J1.5:Creating_custom_template_parameter_types for more information.
For example, the following extract shows a <params> section defining two parameters; one for a drop-down list of template colour variations, the other for a radio button which will allow the user to show or hide an author copyright message.
<params> <param name="templateColour" type="list" default="blue" label="Template Colour" description="Choose the template colour."> <option value="blue">Blue</option> <option value="red">Red</option> <option value="green">Green</option> <option value="black">Black</option> </param> <param name="authorCopyright" type="radio" default="1" label="Author Copyright" description="Show/Hide author copyright."> <option value="0">hide</option> <option value="1">show</option> </param> </params>
The Template Parameters screen for this example will look like this:
File:Template-parameters-example.png
Note: Parameter groups are not currently supported in template parameters.
Tip: To include HTML tags in XML arguments you must encode certain special characters as follows:
Character | Description | Encoding |
---|---|---|
& | Ampersand | & |
“ | Double quote | " |
' | Single quote | ' |
< | Less than | < |
> | Greater than | > |