Home > How-To > Getting Started > Key Concepts > Templates

Templates

The look and features of a WebOnTheFly site are controlled with templates.

Each template is designed to provide a combination of layout and features to meet the needs of a particular type of page. Each page is assigned to a specific template, which may be changed by clicking the 'Change Template' button (usually found in the upper area of each page while logged in as a webmaster).

It's important to understand the difference between templates before changing templates. Depending on a template's design, key features or content elements may disappear from a page when the template is changed.

Design Notes

Templates may contain any standard HTML, JavaScript, Java and Cascading Style Sheets -- as long as they are saved in the “Templates” directory with an extension of “.cfm”.

The static HTML in your template will be shown on every page that uses that template. Then, for each dynamic page element (one that is specific to the page being viewed), insert a single "cf_OnTheFly" tag to incorporate a WebOnTheFly module. For example, a large area of detail text might be incorporated like this:

<cf_OnTheFly module=”Detail” name=”Body Text”>

Master Template

All custom templates are actually included inside a larger template called “Master.cfm”. Its primary purpose is to handle meta tags and other HTML which must be implemented in the “head” portion of the page. You will find the following tag in the Master template:

<cfinclude template=”#template#.cfm”>

This marks the point where your custom template will be inserted. You may position HTML around it, but do not alter the tag itself.

A uniform look can be maintained across all templates by also using the Master template for the “body” tag and any other elements – such as header, footer and navigation – that need to be consistent throughout the entire site.

Default Template (default.cfm)

Since the possibility exists for a template to be removed or renamed after it has been associated with pages in a site, it is highly recommended that the “Default.cfm” template be maintained. It may be modified like any custom template you create. Just be sure that it can handle the basic presentation of a page whose template cannot be found, and that it is called “Default.cfm”.

Modules

For each dynamic page element (one that is specific to the page being viewed), a module displays the content and gives the webmaster the ability to edit it.