Storing template parameter values
From Joomla! Documentation
Revision as of 14:33, 16 August 2008 by Chris Davenport
The current values of the template parameters are stored in the file [path-to-Joomla]/templates/[template-name]/params.ini
If your template has parameters and you intend to create an installer package for it, then you should add this file to the <files> section of the templateDetails.xml file.
<files> ........ <filename>params.ini</filename> ........ </files>
The installer will ensure that the params.ini file has the correct ownership and permissions and so is writeable.
The params.ini file distributed in a template installer package can actually be empty as the default values of the parameters can be set in the <param> elements in the templateDetails.xml file. The presence of the empty file during template installation just ensures that it is writeable. However, if you want to distribute a params.ini file with the default parameter values set in it, this is a simple procedure:
- On your test system, create an empty params.ini file, making sure that it is writeable by the web server.
- Log in to the Administrator back-end and go to the Template Parameters screen for your template.
- Set all the parameters to the values that you want as the defaults.
- Click Save.
- Take a copy of your params.ini file to put into the template package. This now contains all the default parameter values.
Alternatively, you can create a params.ini file by hand as the format is very simple. It is in standard INI file format with one parameter per line. The parameter name and its value separated by an equals sign. For example