A Template Generator For HTML
Creating Pages with Common Elements
By Peter Reppert
Recently, the Webmaster at the fictitious Fang Surfboard Company realized the rapidly growing site lacked consistency. Pages had various headers and footers, and many were missing navigational aids. It was becoming difficult to track who created which document and when. Entering the same header and footer information on each new page seemed like a waste of time; if only there were a tool that could build uniform templates...
To solve this predicament, I've written a simple, form-based HTML template generator that automatically creates headers and footers, allows text entry, has multiple style options (including navigational buttons), uses the <LINK> tag to enter the maintainer, and datestamps the document (along with some other tricks discussed later). Because this is a CGI program, it works right from your browser, allowing you to preview and correct your work before saving. The final result can be hand-edited or used with your favorite WYSIWYG editor. Before we see how the template generator works, I'd like to discuss how and why you might use the program.
The Document Header
Figure 1 is a typical document format for an HTML page. The header is often followed by ways to specify the relationship between documents using this tag; the end is a typical document footer.
This basic header/footer format is serviceable, but has some problems.