Template Sets and Directory Structure
In Siteframe Beaumont, all standard templates are stored in the directory identified by the configuration variable dir_templates, which is usually named "templates" and is created immediately beneath the root directory of the website. Templates that are used by common site functions are stored immediately in that directory and are called "site templates." These templates are used for various purposes:
- RSS/ATOM templates for syndication
- Various types of e-mails for subscription notifications, comments, user messages, and so forth
- XML responses for TrackBack and web services
Beneath the primary template directory are one or more subdirectories; each of these contains a template set, which is a collection of templates for all online content generation. Each template directory (including the site template directory) has a file named template.ini that is used to define the mappings of logical template names (used internally by Siteframe) to the physical template file names provided by the template set. See template.ini for more details.
Template Directory Structure
As an example, assume that Siteframe is installed in /var/www/data, which is the root directory of your website. The various template directories would have a structure like this:
/var/www/data
/var/www/data/templates
/var/www/data/templates/template.ini
/var/www/data/templates/notify.tpl
/var/www/data/templates/... other template files
/var/www/data/templates/default
/var/www/data/templates/default/template.ini
/var/www/data/templates/default/index.tpl
/var/www/data/templates/default/... other template files
/var/www/data/templates/simple
/var/www/data/templates/simple/template.ini
/var/www/data/templates/simple/index.tpl
/var/www/data/templates/simple/... other template files
Template Sets
There are three template sets in this example:
- /var/www/data/templates - these are the site templates for this website, and the physical template files are defined in template.ini.
- /var/www/data/templates/default - this is a template set called "default"
- /var/www/data/templates/simple - this is a template set called "simple"
Each of the template sets is defined by a template.ini file. Note that the name of this file cannot be changed; however, all other template file names can be modified by the template designer, with the logical-to-physical relationships defined in template.ini.
Using Template Sets
Template sets can be used in several different ways. First, the site always has a default template set; this is the template set that is used unless another template set is defined. This is set in siteframe.ini with the configuration variable default_site_templates. Second, a Folder object can use a different template set; this template set is used for that Folder and all Pages in the folder. The folder template set is selected under the "Advanced Options" component when the folder is being edited.
Finally, the template set named "default" is special; it is used if no other matching template set can be found. For example, the default site template set might be "A" and a folder template set is "B". If the webmaster deletes the "A" and "B" template directories (either deliberately or on purpose), then, when the system attempts to render a page in a folder that uses the "B" template set, it will first attempt to use "B". Since that does not exist, it will attempt to use "A", the site default template set. Failing that, it will attempt to use a template set named "default". If that does not exist, then all sorts of nasty things occur, and I can't be held responsible.
Rule: don't ever delete the "default" template set, even if you don't plan on using it. You might replace it with a different template set if you don't like the design, but you should never delete it.
Disabling a Template Set
Over time, there may be dozens of template sets available. If you want to disable one or more template sets (perhaps because they conflict with the overall design or theme of the site), simply rename the template.ini file to something else; for example, template.ini.UNUSED. You could also delete the template directory, but simply renaming the template.ini file keeps the template set available in case it is needed in the future.
