J1.5:Storing template parameter values
(New page: The current values of the template parameters are stored in the file <tt>[path-to-Joomla]/templates/[template-name]/params.ini</tt> If your template has parameters and you intend to creat...) |
m |
||
| Line 15: | Line 15: | ||
The installer will ensure that the ''params.ini'' file has the correct ownership and permissions and so is writeable. | 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 <tt><param></tt> 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: | + | 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 <tt><param></tt> 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 for creating one: |
# On your test system, create an empty ''params.ini'' file, making sure that it is writeable by the web server. | # 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. | # Log in to the Administrator back-end and go to the '''Template Parameters''' screen for your template. | ||
| Line 22: | Line 22: | ||
# Take a copy of your ''params.ini'' file to put into the template package. This now contains all the default parameter values. | # 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 | + | Alternatively, as the format is very simple, you can create a ''params.ini'' file by hand. It is in standard INI file format with one parameter per line. The parameter name and its value are separated by an equals sign. For example: |
<source lang="ini"> | <source lang="ini"> | ||
templateColour=blue | templateColour=blue | ||
Revision as of 15:42, 20 August 2008
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 for creating one:
- 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, as the format is very simple, you can create a params.ini file by hand. It is in standard INI file format with one parameter per line. The parameter name and its value are separated by an equals sign. For example:
templateColour=blue authorCopyright=1
