| Site map | Quick index | Copyright | Postscript |
7 Templates
Templates are basically pages having some content (eg a letter head) which can
be re-used to create other pages which will have the same underlying page structure and, often, the same graphical
layout.
Templates are not altered in use and can be used
over and over again. The simplest template is probably a blank sheet
which links to a stylesheet for use throughout a site. More common is a
page which has a banner and perhaps a menu to appear on every page.
Last might be a complete page layout for use on all, or many, pages of
a site but which includes areas for customising individually.
Templates may be considered as having two parts – the fixed
part or ‘boilerplate’ which remains the same for
every page and the editable part which changes.
Nvu recognises two types of editable part. Block and flow. Block items are like any other html block and may consist of paragraph-like items or divs (which may contain several blocks). Blocks may be made repeatable - so that several similar items may be added if required.
Flow items will be contained within other block items in line with the text, for instance to change one or two words in a paragraph.
Templates are prepared and
edited using Nvu just like any other page.
To create a template
Fill these in using dummy text so that a complete page layout is achieved even though some of it may be meaningless. Format this as required.
Note
Useful dummy text can be
found at
http://www.lipsum.com/.
Note There are other approaches to page layout but the method described is simple and reliable.
The first figure shows a page prepared as described.
To save a template
The extension ‘mzt’ will be selected automatically.
A pre-existing document may be transformed into a template
The content of the page -
boilerplate and examples of editable content - should already be set up
and formatted.
To
make blocks editable
Note The
option ‘Area is optional’ allows
it to be
deleted easily when the page is in use.‘Area is
repeatable’ allows copies to be made rapidly.‘Area
is moveable’ turns the area into a movable layer (see section
3.10).
Warning In Nvu 1.0 this option is disabled
6 Click OK.
To make a flow selection editable
Note The option ‘Area is moveable’ is inappropriate for flow areas).
6 Click OK
When you have finished save the template as described in section 7.3
The second figure (above) shows a template at this stage. It has one non-repeatable block item - The program name, Two non-repeatable flow items - The Date and Language, Two repeatable flow items - The Changed areas and Other languages; the second of these is optional.
7.6
Using
templatesTo base a page on a template first ensure that the template itself has been saved and closed – a page cannot be based on an open template.
Note All pages which Nvu creates which are based on templates are created as HTML documents using the Transitional doctype. It is not possible to create XHTML documents or those with Strict doctypes from templates.
To create a page
The page that appears carries
To use the page
Warning - At Nvu 1.0 the text for repeatable items cannot be edited at this stage however copies may be made for editing later.
When all editable boxes
have
been
completed detach the page from the template by clicking Edit >
Detach from template. The
page now assumes its final appearance.Now it is possible to edit any item and as a workaround the frozen repeatable items may be added.
Templates which have already been saved may be altered after opening using menu commands File > Open File and selecting ‘Files of Type’ then ‘HTML Templates’.
Note The default opening setting is ‘HTML Files’ which will not open templates.
| Site map | Quick index | Copyright | Postscript |
Nvu User Guide - Based on Nvu version 1.0 - Updated 14-March-2006