Web Site Design Guide (logo)
Good Design ConventionsThe Electronic PageCascading Style SheetsTemplatesLibrary Items and AssetsBad Design FeaturesForms
HTML Templates
Overview
Why Use Templates
Dreamweaver and Templates
Creating Template
Regions

What and Why are Templates?

An HTML template is really a reusable file that separates form from content. It incorporates non-editable elements common to a whole website, as well as editable regions for content that changes.

Most pages within a website for a travel agency, for example, would look similar and function in basically the same way. The page layout for a Cairns holiday package page would be very similar to the one for Great Britain. Both would display the same logo, navigation and search facility. One page, however, would describe sunny beaches and display a photo of a tropical fish, while the other would describe Trafalgar Square and show Buckingham Palace.

A template designed for this site would include common elements that would be non-editable: in this case the logo, navigation and search facility. It would also include editable regions containing placeholders for content specific to each page: the main text, the photograph and the heading.

Why Should I Use Templates?

Using web templates is all about consistency, efficiency and economy.

As web pages based on a template will inherit the template's properties, you can have confidence that common page elements will display exactly as intended on all pages throughout a site. Inconsistencies in layout, graphics, text and links, in the non-editable elements, can be eliminated. The result is a more professional-looking site where the user will experience the same look and feel no matter where they are. This is especially important when you are dealing with a large, or potentially large, website.

Development time can be cut dramatically when page creation is simply a matter of inserting content into a pre-constructed file. This can be particularly useful when there is an urgent deadline.

Using templates not only saves time at the development stage, but also has the potential to reduce work in the quality assurance or testing phase. As each page is essentially a copy of an original it is only necessary to test the editable content of each page.

Cross-platform and browser issues can be resolved in the initial stages of development. As long as the template is bug-free you can relax knowing that any pages based on it will probably also be bug free.

Some maintenance procedures can be simplified by the use of templates. If, for example, your client wants the company logo updated, it is only necessary to make the change once: in the template. The logo will then change throughout the entire site. This is far easier and cheaper than altering every page.

Top of Page

Dreamweaver and Templates

About Defining Template Regions

A template determines the basic structure for a document and contains elements such as text, images, page layout, styles, and editable regions.

Dreamweaver automatically locks most regions of a document when you save the document as a template. As a template author you define which regions of a template-based document will be editable by inserting editable regions or editable parameters in the template. As you create the template, you can make changes to both editable and locked regions. In a document based on the template, however, a template user can make changes only in the editable regions; the locked regions can't be modified.

There are four types of template regions: editable regions, repeating regions, optional regions, and editable tag attributes.

You can create a template through the New Document dialog box (File >New) provides several options for creating new templates, and creating template-based pages.

Dreamweaver saves templates with the file extension .dwt. Templates are saved in a special Templates folder in the local root folder of the site. If the Templates folder does not already exist in the site, Dreamweaver automatically creates it when you save a new template.

Note: Do not move your templates out of the Templates folder, or put any non-template files in the Templates folder. Also, do not move the Templates folder out of your local root folder. Doing so causes errors in paths in the templates.

Top of Page

How to Create Dreamweaver Template Regions

An editable region is an unlocked region in a template-based document; a section a template user can edit. A template author can define any area of a template as editable. For a template to be effective, it should contain at least one editable region; otherwise, pages based on the template can't be edited. For information about inserting an editable region

Inserting an Editable Region

Before you insert an editable region, you should save the document you are working in as a template. If you insert an editable region in a document rather than a template file, Dreamweaver warns you that the document will automatically be saved as a template.

To define an editable template region:

  1. In the Document window, do one of the following to select the region:
    • Select the text or content that you want to set as an editable region.
    • Place the insertion point where you want to insert an editable region.
  2. Do one of the following to insert an editable region:
    • Choose Insert > Template Objects > New Editable Region.
    • Right-click (Windows) or Control-click (Macintosh) the selected text or object, and choose New Editable Region from the context menu.
    • In the Insert bar, select Templates, then click the Editable Region button. The Editable Region dialog box appears.
  3. In the Name text box, enter a unique name for the region. (You cannot use the same name for more than one editable region in a particular template.)
    Note: Do not use special characters in the Name field.
  4. Click OK.
Top of Page
 
Good Design Conventions The Electronic Page Cascading Style Sheets Templates Library Items and Assets Bad Design Features Forms
Hosted by www.Geocities.ws

1