Information in this help file pertains to: template.htm

What is template based display?

Template based display is a very powerful feature that allows you unlimited control over the look and feel of your calendar. This is accomplished by providing three custom HTML tags that you may insert into a template file called template.htm. Theses custom tags allow you to include parts of the calendar directly into a web page.

The template.htm file must be placed in the program's data folders. If the file is found in a particular calendar's data folder it applies only to that calendar only. If the template.htm file is found in the root of the data folder it applies to all calendars.

Each time the program runs it looks for template.htm. If the template is found it is scanned looking for one of these three tags. If a tag is encountered it is converted into the corresponding HTML code to render that item. Text not recognized as a custom tag is passed through untouched. The custom tags, which are case insensitive, all begin with '<cw_'.

The custom tags

Like other HTML tags the three custom tags allow attributes that indicate options for the tag. For example, the <cw_a> tag has an attribute called 'cmd' which can take on values such as 'calendar', 'task', or 'contact'. When the tag is processed the HTML code for the command will be inserted in place of the tag.

Details about each of the three tags are presented in the following help pages:

An simple example

The simplest possible template.htm file is this:

Store this code in a file called template.htm in the root of the data folder (./data/calweb). Just the body of the calendar will display - no header or footer. For a larger collection of examples of the template based display feature see the folder called ./data/samples. This folder contains a readme.htm file which explains how to use the samples. The example of most interest is the file called alltags.htm. This example shows you every available tag in action.

Where to store the template file

Place the template.htm file in the topmost folder of the data folder (./data/calweb) or any individual calendar's folder. In the first case the template will apply to every calendar. In the later case only the particular calendar will use the template. You may specify the template file on the URL by appending tmpl=filename.htm. This method allows you to show the calendar using a template in some cases and not others. Use tmpl=none to show the calendar with no template.