Creating Templates in Dreamweaver

Templates are used to create documents that have a common structure and appearance. Templates are useful when you want to make sure that all of the pages in a site share certain characteristics. You can design a template to have graphics and navigational links that you want to be shared by all of the pages in your site. When changes are made to the template, they are automatically changed on all of the pages that were created from that template. The template also contains spaces for content that can be edited on the individual pages.

Getting Started

Creating a Template

You can create a template from an existing HTML document and then modify it to suit your needs, or you can create a template from scratch, starting with a blank HTML document.

Dreamweaver saves templates with the file extension .dwt in a folder named Templates in your site's local root folder. If the Templates folder does not already exist, Dreamweaver creates it when you save a new template.

Note: Do not move your templates out of the Templates folder, or put any nontemplate 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.

To save a document as a template. :

Defining a template's editable regions

In a template, editable regions are the parts of the page that can be changed in files based on the template—for example, the text of an article in a newsletter would appear in an editable region, so that every article could contain different text. Locked (noneditable) regions are the parts of the page layout that remain constant from one page to another.

All regions in a new template are locked when you create the template, so to make the template useful, you must make some regions editable (unlock them).

While you are editing the template file itself, you can make changes to both editable and locked regions. In a document based on the template, however, you can make changes only to the editable regions of the document; the locked regions of the document can't be modified.

To define existing template content as an editable region:

  • In the template file, select the text or content you want to change to an editable region.
  • Choose Modify > Templates > New Editable Region.
  • In the New Editable Region dialog box, enter a unique name for the region. (You cannot use the same name for more than one editable region in a particular template.)

Creating a New Document Based on a Template

Applying a Template to an Existing Dreamweaver Document

Changing a Template and Applying Changes to Other Documents


Last update: October 8, 2006