|
You are here: Home / Template Modes |
Template ModesMay 4, 2005 A newer and less documented part of Sitellite's concept of template sets is the modes.php file. The modes.php file allows you to control certain aspects of the different output modes offered by your template set. An output mode is the file/data type of the content generated by a request to the Sitellite Content Server. For example, ordinary pages on the web are in HTML format, so the default output mode is html. It has a content/mime type of text/html. An alternate output mode might be WML, RSS, or RDF. Alternate output modes are automatically added to your HTML output in the form of <meta rel="alternate" /> tags in the <head> block. This is done via XT's tag binding feature, which means you don't need any special tags in your HTML document for this to take place. File FormatThe modes.php file lives in the base folder of your template set and is an INI-formatted file, although it is recommended you edit it via the SiteTemplate "Edit Properties" form instead of modifying the file directly. This file contains INI "blocks" that each describe an output mode. You will find an example modes.php file in the default template set that comes pre-installed in new installations of Sitellite. This example contains the following: ; <?php /* [html] content_type = text/html filter 1 = "body: saf.Misc.Search" ;filter 2 = "body: siteglossary.Terms" ; */ ?> The first and last lines of the file contents are standard INI security measures, which prevent the rest of the file contents from being read by visitors accessing the file directly through a web browser. The [html] line denotes the start of the html output mode description block. A block ends when a new block starts, or at the end of the file. The content_type value is the mime type of the output mode, sent to a visitor's browser in the Content-Type HTTP header. The filter n lines are a numbered list of filters that can be applied to a given field before its output is passed to the XT templates that make up your template set. These can be used to add certain highlighting features to your content, or to format fields that need tweaking for a certain output mode. The field value begins with the name of the field, which can be any of the columns from the sitellite_page database table, or the special field value final which transforms the finished template output, followed by an SAF package name (separated by a colon). The package references must include a function to transform the field named according to the following rules:
Page 1: File Format |
|
Copyright © 2008, SIMIAN systems Inc. All rights reserved. Privacy policy Some of the icons on this site were created by the Gnome Project. |