Introduction
  Publishing web pages
  RXML
  Information tags
  String tags
  Variable tags
  URL tags
  If tags
  Graphics tags
  Database tags
  LDAP
  Programming tags
  SSI tags
  Image maps
  IntraSeek
  LogView
  Templates
    <tmplinsert>
    <tmpldefault>
    <tmplblock>
    <tmpldefaultparam>
    <tmplinsertblock>
    <tmplinsertall>
    <tmplinsertexcept>
    <tmplhelp>
    Examples
    Default template
  Navigation
  SiteBuilder tags
  Supports system
  Security
  Appendix
 
Templates

Templates is an integrated part of Roxen SiteBuilder used to separate content from layout. It works by transforming content files to RXML files according to a template file. This is done on demand and the result is cached by the web server for performance.

Usually the template determines the fundamental layout of the web page; where the navigation interfaces are, where the title is shown, what the background is etc. If there is a table defining the basic structure of the web pages it is also included in the template. With templates it is possible to define and redefine RXML and HTML tags. The custom tags can be simple tags used in the content to control the look of headers and such, but they can also be used to control the layout and structure of the pages.

Templates also provide simple creation of advanced graphical and non-graphical navigation interfaces. The look of the interface are defined in the template and the titles and links are either taken from the site structure or from special menu definitions. The menus will of course make use of Access Control, so that only the files or directories the user has permission to visit are shown in the menu.

These functions enables the designer to effortlessly keep a consistent design on the whole web site and at the same time simplify the process of creating content for the editorial staff.

Content processing
The illustration below shows how the content is processed.

  1. At the start we have the empty content file, containing some text and an inline image.
  2. The first template processing step is to apply the template to the content. In this step all custom tags are replaced by their definitions, and custom tags controlling layout are inserted.
  3. Next the navigation buttons are added, these are either taken from menu definitions, the site structure or a combination of both. The navigation buttons are sensitive to where the web page is located and can indicate which page is currently being visited. It is also possible to present the site structure in a hierarchical way by only showing the files and folders below the current page.
  4. Finally the Access Control parses the menu, hiding the buttons the user is not permitted to visit.


Content processing

Modules
The three modules most important for templates are the Templates module, the Sitebuilder tags module and the Navigation module. The Templates module is used when defining the web page structure and the custom tags. The Navigation module creates the navigation buttons and the SiteBuilder tags-module provides additional tags useful when creating templates.

Using different templates
When the user views a web page from a SiteBuilder site, the content is inserted according to the definitions made in the template chosen for the page. Which template to use is determined by the template field in meta data, but it may also be forced by adding ?tmpl=the-template.tmpl to the end of the url. The templates are stored in the /templates/ directory.

Templates processing
Templates work by providing the framework for each generated page, as well as defining custom tags. Custom tags are tags that can be used within the content files, and will be replaced according to the definition in the template.

Templates can be used in different ways. The template could only provides custom tags, and not interfere with the content file in any other way. Or templates could be used to control the exact layout of the generated page, only inserting data from the content file in specific places. A database application could use a template to controls exactly how and where fields should be printed.

The most common case is something in between, where the template defines the overall layout while the content file is inserted as is somewhere within that overall layout.

The template processing is driven by the template file. It is only when certain tags are used that information is fetched from the content file. It is possible to insert information several times from the content file, for example to first create an index over the headers and then insert the whole file. It is possible to change the definition of any custom tags between these inserts.

Parse order
All template tags are evaluated first, to generate a RXML page. In this step the information from the content file is inserted, and becomes part of the RXML page. The generated RXML page will then be sent through the RXML parser to produce a HTML page. It doesn't matter whether the RXML code is in the template or in the content file, it will be evaluated at the same time.

When generating the RXML page it is the template file that is evaluated. Any RXML in the template file will be sent right through to the generated RXML page. The template tags <tmplinsert>, <tmplinsertblock>, <tmplinsertall> and <tmplinsertexcept> can then be used to insert tags from the content file, or the entire content file.

The template tags

<tmplinsert>
Inserts the contents of the first occurrence of a container tag from the content file. It is useful for handling tags that there should only be one instance of, like the <title> tag in HTML.

<tmpldefault>
Default value for the <tmplinsert> tag in case a container tag doesn't exists in the content file.

<tmplblock>
Defines a new tag or container tag.

<tmpldefaultparam>
Is used within a <tmplblock> tag to define default values for attributes.

<tmplinsertblock>
Inserts one or more tags from the content file. All occurrences of the tags will be inserted.

<tmplinsertall>
Insert all tags from the content file.

<tmplinsertexcept>
Insert all tags from the content file except these.

<tmplhelp>
Define a help text for the template, a tag or an attribute of a tag. This help text will be shown when viewing the template source.