2.4 Templates

Templates allows pages to use a common layout which is used to keep a consistent layout on a website or keep the format of documentation pages the same. Templates also allow small tweaks to the page layout to be made without needing to edit each page so the change is reflected in all of the pages by simply changing the template layout and then recompile the pages.

The list of templates can be accessed by clicking on the 'View Templates' link. A list of templates from the template database should then appear. If the template database does not exist then a message will appear saying that the template database does not exist and will be created when a template is added. If no templates exist in the template database then a message appears saying that there are no templates in the template database.

2.4.1 Add a template

To add a template to the template database click on the 'Add Template' link from the View Templates sub-menu, a form then appears allowing to enter the new information about the template.

Setting Description
Template Name Specifies the template name to be used.
Template Description Specifies the template description to be used.
Template Filename Specifies the template filename to use.
Template Layout Specifies the content of the template layout.

The following Kiriwrite tags can be used with the template layout to automatically place information such as page content, name, description and section:

Tag Description
<kiriwrite:pagecontent> Places the page content here.
<kiriwrite:pagetitle> Places the page title here. The format of the page title can be changed using the Page Settings value.
<kiriwrite:pagename> Places the page name here.
<kiriwrite:pagedescription> Places the page description here.
<kiriwrite:pagesection> Places the page section here.
<kiriwrite:autosection> Places the automatic page section here.

Note
If there is a page section then the page section will appear bracketed. If Information was the page section then the automatic page section name would be '(Information)' and if the page section name is blank then no brackets will appear and will be blank.
<kiriwrite:autotitle> Places the automatic page title here. This combines the section name and page name with brackets around them and a dash separating them with '(Section Name – Page Name)' being the example. The format can be changed by changing the Page Settings value.

After entering the needed template information, click on the 'Add Template' button to display a confirmation message saying that add the template to the list of templates in the template database and offering a link back to the list of templates in the template database. Clicking on the 'Clear values' button will clear all of the template settings entered. Clicking on the 'Return to the template list.' link will return to the list of templates in the template database.

2.4.2 Edit a template

To edit a template click on the 'Edit' link opposite the template name you want to edit, a form then appears that is similar to adding a template.

Setting Description
Template Name Specifies the new template name to be used.
Template Description Specifies the new template description to be used.
Template Filename Specifies the new template filename to use.
Template Layout Specifies the new content of the template layout.

The Kiriwrite tags used when adding a template can also be used when editing a template.

Tag Description
<kiriwrite:pagecontent> Places the page content here.
<kiriwrite:pagetitle> Places the page title here. The format of the page title can be changed using the Page Settings value.
<kiriwrite:pagename> Places the page name here.
<kiriwrite:pagedescription> Places the page description here.
<kiriwrite:pagesection> Places the page section here.
<kiriwrite:autosection> Places the automatic page section here.

Note
If there is a page section then the page section will appear bracketed. If Information was the page section then the automatic page section name would be '(Information)' and if the page section name is blank then no brackets will appear and will be blank.
<kiriwrite:autotitle> Places the automatic page title here. This combines the section name and page name with brackets around them and a dash separating them with '(Section Name – Page Name)' being the example. The format can be changed by changing the Page Settings value.

After editing the information about the template, the template can be edited by clicking on the 'Edit Template' button which will display a confirmation message saying that the template information was edited offering a link back to the list of templates in the template database. Clicking on the 'Restore current settings' button will undo any changes and revert to the currently used settings. Clicking on the 'Return to the template list.' will return to the list of templates in the template database.

2.4.3 Delete a template

To delete a template click on the 'Delete' link opposite the template name you want to delete, a message then appears asking to confirm the deletion of the selected template. Clicking on the 'Yes, delete the template' button will display a confirmation message saying that the selected template has been deleted offering a link back to the list of templates in the template database. Clicking on the 'No, return to the template list.' link will return to the list of templates in the template database.