Tip #28

What are templates?

A Dreamweaver template is a layout for a particular document on your site. It is based on the idea that different pages on your site often have a common appearance--a similar graphic or heading, perhaps a set of navigation options on the top, left or bottom of the page, and perhaps a footer with similar information. There are no templates that ship with Dreamweaver. Templates have to be created, and are stored in a special directory named Template. There can be multiple templates for a site, for example, one for secondary level pages and maybe two or three content type of layouts.

This particular site has two templates associated with it. As is shown in the screen capture to the left, under the Templates option Dreamweaver will list all sites defined on your local copy of Dreamweaver. You can see here that the site of ecat has two templates associated with the site.

Unless you have inherited a template with your site or have created a template yourself, you won't see any options for templates on your site.

Once there is at least one template in your site, you can use the option under File of New and select the tab of Templates. If there are templates associated with that site, you can select one.

This is an example of a template for the ECAT site. As with any template, a part of the document is protected and cannot be changed, but other parts of the layout (called editable regions) can be changed.

Sample template which has three editable regions.

In this particular template, there are three parts that can be changed: the title at the top of the page, the body (text body), and the footer area which has information about the URL location and dates changed, plus possibly a contact link. However, only text can be changed here. The fonts and colors for each of these regions is fixed and cannot be changed. The image showing in this template, at the top of the template, has has hot spots on the image (the light aqua color). This graphic header cannot be deleted or moved, and the redundant text links at the bottom of the page are also fixed and cannot be edited or deleted.

In order to change a template, you must deliberately open that template file (stored in its own folder, not with the rest of your documents) and make changes in the template and resave the file as a template.

One of the advantages of using templates is to ensure a consistent look about pages, even if pages are being created by others. This is particularly useful if multiple people are creating documents, but you, as the site manager, want all the pages to look the same. Another advantage of templates is that you can edit the template (for example, change the image being used) and these changes are made across the site in any document using the template. This is an advantage even if you are the only one working on a site. As your site gets larger, this is a great time-saver.

Be sure to check out the video about using templates.

These tips are created as part of a class on Dreamweaver Basics.