HowTo: customize templates
You could, of course, simply edit the provided template files and save them. However, in doing so, you run the risk of having your modifications overwritten when a new version of the software is installed. Siteframe provides features that allow you to customize your templates safely and maintain your changes between software releases.
The custom.ini File
The template.ini file provides a mapping between a logical template name (for example, "index.php") and a physical template filename (such as "index.tpl"). Siteframe also looks for a file calle custom.ini in the template set directory (i.e., in the same location as template.ini). If the file exists, any entries in it will replace the corresponding entries in template.ini.
For example, if template.ini includes this:
index.php = index.tpl
And custom.ini contains this:
index.php = myindex.tpl
then the template file "myindex.tpl" is used instead of "index.tpl" for the home page (index.php). Since neither custom.ini nor myindex.tpl are shipped with the software, they won't be replaced if you upgrade.
Template Customization, Step-By-Step
Here's a rough overview of the steps necessary to create and use a custom template:
- Create your custom template file; often, you can simply copy the existing file and then modify it. In our example, above, you'd copy index.tpl to myindex.tpl and make any desired changes.
- Add your template to the custom.ini file. In this example, you'd add the "index.php = myindex.tpl" line to custom.ini. Remember that custom.ini needs to be in the same directory as template.ini.
Once you've done this, your new template should be active instead of the old one. If it's not, refresh your browser (to clear the cache) and check the spellings in the custom.ini file.
