OpenForum comes with a number of predefined templates that can be found from the /OpenForum/Styles page. The following notes are for those wishing to make changes to templates or create new ones.
There are three different template files that can be applied to an OpenForum page.
- header.html.template - Contains HTML defining the top of the page
- footer.html.template - Contains HTML defining the bottom of the page
- edit-form.html.template - Contains HTML defining the page's edit form
The pages content in sandwiched between the header and footer templates as is the edit-form template, when the page is displayed in edit mode.
OpenForum/Page holds the default header and footer. You can define headers and footers on any page. Alternatively you can link to a template somewhere else.
Within a page template, some standard OpenForum information can be inserted. These are inserted by placing tags in the template. A tag begins with an ampersand & and is terminated with a semicolon ;. So to insert the authors name into a template you would insert the tag &author;. The list of standard page tags is as follows:
Standard Page Tags- pageName
- title
- author
- referringPages
- attachments
- tags
- author
- time
- insert:(Wiki page)
The insert tag is a special case. It is followed by a reference to a WikiPage. When a page is updated the reference page's contents is pasted in.
Case Study - Vanilla Top (From the Classical Style Set)We are going to dissect the page template for Vanilla Top as an example of how to create a page template. You will need to know a bit of HTML. You can view the finished result here page-header-vanilla.html.template
First the head of the page is defined, inserting the title and author.
&title;
The CSS style sheet is defined. In this case the page-vanilla.css references all other style sheets required.
Now the standard Javascript used in the page is imported. Note the pageName tag being used to pick up the page specific Javascript.
Next is the pages body. The onload attribute is set to call the generic init Javascript function. This, in turn, calls all other initialise functions that have been defined.

|