Site-Wide Page Templates

As we saw when discussing creating pages, Dreamweaver comes with a wide range of page templates. These templates allow you to create pages with a variety of layouts. The disadvantage of using one of these layouts everytime you create a page is that any changes you have made to the page which are not captured in CSS must be redone for each new page.

The advantage of creating and using a site-wide page template is that you can set up the template with all of the necessary elements, such as logos, menu bar etc, and then use the template to create exactly the new page you require for your site. Further, if you make a change to the template, Dreamweaver will automatically update every page in your site that is based on that template.

This is a powerful tool for managing large sites!

Creating the Initial Template

You create a new template using the same dialog that you use the create a regular page. Instead of selecting a Blank Page, you select Blank Template and then HTML template, as shown in the dialog below. For the layout you can pick which ever page layout best suits your design, or start from scratch with no predefined layout <none>. When you are creating your page template, you will probably not have any CSS set up, so you need to create a new file for the layout CSS.

Page Template Dialog

Creating the template will result in a new folder in your site called Templates and, within that folder, a file with the extension .dwt for Dreamweaver Template. This is essentially an HTML file, but with special regions within it that Dreamweaver controls, and editable regions that you can modify for each page that you make.

Completing Your Page Template

You complete the design of your page template as if you are making a skeleton page. You include all the elements that should appear on every page of your site, such as the logo, the menu bar and so forth. You leave gaps where the actual content of individual pages will appear. These gaps are known as editable regions. You need to include an editable region for ever part of the page where you want to be able to add content.

Note that once the template is complete you cannot edit any parts of the individual pages which are not defined as editable regions in that template. This is to protect the integrity of the site-wide design. This helps enforce a design discipline - you need to ensure that your page design is complete and stable before you start building the site.

Creating a New Page

Once you have your template, you can use it to create new pages. You select the Page from Template option in the New Document dialogue. Note that Dreamweaver shows you all the sites that it is currently managing for you, so make sure that you select the correct site in the second column. It will then show you the available templates for that site in the third column and a preview in the final column.

Create New Page

You will generally want to make sure that the created page updates automatically if the template changes, but just in case you don't want that to happen you can uncheck that option.

There are no other choices to be made, as everything is encoded in the template itself.

Links

Back back to the main Dreamweaver page