Current Page:  Documentation / Customising tdg

Customising tdg

We're all familiar with the scenario... you design an absolutely gorgeous website, artistic, elegant, stylish; then you set up a couple of CGI applications to handle some interactive tasks and they completely ruin the theme.

In most cases, computer programmers are not good graphic artists / designers.  At Digital-Word.com we recognise this; and have written tdg in a way that allows the output to be totally customised to match or compliment the design of your website, for a totally integrated guestbook system.

The standard tdg distribution includes seven ".template" files.  These files are standard HTML documents (but with a ".template" extension, instead of the more usual ".htm" or ".html").  You may be wondering why we haven't used the standard extensions: well, if we did, the templates could be accessed directly by their URLs; furthermore, Internet search engine "bots" would be able to index and catalogue them.  As we don't want these pages to be viewed without their embedded guestbook content, we use the non-standard file extension.  In doing so, we make them virtually inaccessible to anything bar tdg as a result.  They are still directly accessible by URL (if their exact address is known), but the web-browser would try to download them as files, rather than display them.

Three of the templates affect how your tdg will appear on the Internet, the remaining four govern administration displays and the HTML-format e-mail generated by tdg (nine times out of ten you won't change these, but they're available for editing should you decide to).

All the templates can be loaded into any website authoring package (FrontPage, DreamWeaver, etc).  However, you should rename each template with a ".htm" or ".html" suffix prior to opening them (simply because the authoring package won't recognise a ".template" file as a valid HTML document).  When you have finished editing a template, save it, then rename the resulting file back to a ".template" file.

Every template contains special embedded place-holders that tdg replaces with its' output at runtime.  The place-holders are always in the same format; "%%%tdg_command%%%".  Don't change or omit these - design your page around them.  However, the "%%%credits%%%" placeholder can be removed if desired; this simply adds a discreet tdg credit to the pages if included.

There are just a couple of rules that you need to keep in mind when editing / designing templates:
  1. the "%%%header%%%" place-holder must always be within the <Head> ... </Head> tags of your document

  2.  
  3. the "%%%index%%%" place-holder can be anywhere in the body of the document - this will be replaced with the guestbook entries list

  4.  
  5. the form field names (within "entry.template") and corresponding place-holders (within "preview.template") must not be changed.  You can accommodate them in your web pages however you wish but the names must remain the same

  6.  
  7. the "%%%start_form%%%" and "%%%controls%%%" place-holders are tdg substitutes for the <Form> ... </Form> tags of a regular HTML form and must be included in the "entry.template" and the "preview.template"

  8.  
That's all there is to it.

 
tdg .template gallery

We'd like to introduce a "Template Gallery" to this website as soon as possible; this would provide a range of templates for tdg that could be downloaded and used by others.  So, if you produce a stunning tdg template set, please e-mail it to us at [tdg_template @ digital-word.com].  If you're a Perl programmer and you add features or make other amendments to tdg that you think others would benefit from, then send us them too.  We'll add all submissions to the site with full credits.