Introduction to template parameters
From Joomla! Documentation
Revision as of 15:14, 16 August 2008 by Chris Davenport
To see an example of template parameters in action, go into Extensions → Template Manager and click on the rhuk_milkyway template. You will see, on the Template: [Edit] screen that there is a Parameters group containing a couple of fields called Colour Variation and Background Variation. See illustration below. These are typical template parameters and in this case they control the colour scheme of the template.
Template parameters allow the administrator to adjust the behaviour of a template using a form in the Administrator. What parameters are available and what they do is down to the template designer, but designers now have a set of easy-to-use tools for building flexibility into their templates. For the designer, this involves making changes to three elements:
- Adding a <param> element to the <params> section of the templateDetails.xml file. See Defining a parameter in templateDetails.xml.
- Adding a line to a params.ini file which will hold the current value of the parameter. See Storing parameter values.
- Adding code to the template PHP file to retrieve the current value of the parameter and act on it. See Retrieving parameter data in a template file.