« Return to Part 2: Site Management
Part 3: Using Templates
A Template is a document that is used as the base or starting design for another document. In Dreamweaver, Templates provide a convenient way to keep design consistent among your pages without having to update each page by hand. A Template has static regions that remain the same on all pages and editable regions that can be altered.
- You can make a change in the Template and apply the change to all pages based on that Template with just a few clicks. No need to open each document, cut and paste, etc.
- You can have multiple page designers working on a site but ensure they can only edit what they need to. If using Dreamweaver, they can only edit the regions defined as "editable."
This section covers:
- Creating a Dreamweaver Template
- Creating a webpage based on a Template
- Making changes to a Template and updating webpages based on that Template
Creating a Dreamweaver Template
If you haven't already, define a site in Dreamweaver (see previous section). You must define a site to save and use Templates, because Dreamweaver associates the Templates with a site.
To create a Template from scratch, follow these steps:
- On the Menu go to File > New. . . The New Document dialog box opens.
- Select the General tab. Under Category, choose Template page. Under Template page, choose HTML template. Check the "Make XHTML compliant" box, if desired, then click Create (see Figure 17).
Figure 17: Creating a Template in the New Document dialog box

- You will be presented with a blank webpage in the Document Window. Add content as desired.
- Define one or more Editable Regions by going to Insert > Template Objects > Editable Region (shortcut control-alt-v ) and assigning a name for the region. (To make a large area of the page editable, select everything that you wish to fall within the editable area before following this step.)
- Go to File > Save as. In the Save as dialog box, specify a name for the Template next to File name : and click Save.
- The file is saved in the Templates folder for your site as filename.dwt . You can now create pages based on this Template.
To create a Template based on an existing webpage, follow these steps:
- Open the page you wish to convert into a Template.
- Define one or more Editable Regions by going to Insert > Template Objects > Editable Region (shortcut control-alt-v ) and assigning a name for the region. (To make a large area of the page editable, select everything that you wish to fall within the editable area before following this step.)
- Go to File > Save as Template.
- In the Save as Template dialog box, specify which site to associate the template with, and specify a name for the Template next to Save as: (see Figure 18). Click Save.
Figure 18: The Save as Template dialog box

- The file is saved in the Templates folder for your site as filename.dwt. You can now create pages based on this Template.
Creating a webpage based on a Template
In a webpage based on a Template, you will only be able to alter the page contents in the sections defined as editable in the original Template. Follow these steps to create a webpage based on a Template:
- Go to File > New.
- Select the Templates tab.
- Under Templates, choose the site to which the desired Template belongs.
- Under Site: "your_site_name", choose the desired Template. A preview of the design will appear in the box the right.
- Make sure the "Update page when template changes" box is checked and click Create (see Figure 19).
Figure 19: New from Template dialog box

- Add content as desired in the Editable Regions . You can also edit the document title and insert code in the head if necessary.
- When you are finished editing, go to File > Save as. and specify a name for the file. It will be saved as filename.html
Making changes to a Template and updating webpages based on that Template
You can edit a Template as you would any other webpage. Just open the document in Dreamweaver and make your changes.
The trickier part is making sure your changes are applied to all the webpages based on that Template. To do that:
- Ensure you have copies of all the site files in your local folder. Dreamweaver searches the local files to see which pages are based upon your Template. If you don't have all the files, switch to Remote view, highlight the site's root folder, and click Get (the green down-arrow).
- After editing the Template, go to File > Save.
- Dreamweaver will ask you if you want to update all files based on this Template. It will also show you a list of these files. Click Update.
- If you have Check-Out/Check-In enabled, Dreamweaver will warn you that the page(s) cannot be updated unless you check them out. Click Yes and Dreamweaver will check them out for you.
- The Update Pages dialog box will appear letting you know how many pages were examined and updated. Hit Close when finished.
- If you have any of the files open, be sure to save the changes. If you checked out the files, remember to check them back in to the server.
Sometimes the update will not apply successfully to all pages (for instance, if another user had the page open). To update a page individually,
- Open the page that needs to be updated.
- Go to Modify > Templates > Update Current Page.
- The update should apply. Be sure to Save the changes.
Last updated April 19, 2007by rg


