Macromedia Dreamweaver MX
 
 
Building a Template
 

Building a Dreamweaver Template

A Dreamweaver template allows you to create a shell web site with common elements, such as a title, navigation scheme, and footer that will appear on each page in your web site. When you update a template, every page based on that template is then also updated. The only parts of a page based on a template that are not updated are the parts you specifically designate as "editable regions". This can save a lot of time on large web sites! To build a DreamWeaver template:

From the new document dialog box, choose HTML template.

You will be presented with a new document window, in which you can build a shell for your new web site.
A typical shell might look like this:

My title
Menu Item 1 MainBody
Menu Item 2
Menu Item 3
Last update: February 14, 2005

 

 

 

 

 

 

When you are done building your template, choose File > Save As Template. 

Notice that in the title bar, you are told you are now working with a <<Template>>.

Also note in your Site Window that a folder/directory called Templates has been created, where your new Template (*.dwt) file resides.

After creating a Template, you can choose where you'd like to make areas in your page Editable. The remainder of the Template, the Un-editable parts, will be unchangeable from any of the HTML pages, and can only be changed in the *.dwt files themselves.

You can define more than one editable region. Click your cursor where you'd like an editable region to appear. From the Insert > Template Objects menu, select Editable Region.

In the New Editable Region dialog box, give this area a name. The name is important and should relate to the content you intend to place in this region. Note that the editable region will look like the name of your new editable region, surrounded by a pale blue box.

Now you can save your template.

To create a new page based on this template, create a new page and then click on Modify > Templates > Apply template to page. You'll be asked to choose which template to apply from a dialog box. Once your template is applied to the page, you will only be able to access and change the portions you made editable. These regions will all appear in blue boxes. You can overwrite the editable region name inside the blue box with any objects you like, and you will see that the blue box expands as you add content.

Save and upload your page as you would any other page, and you're done!

Note: If you make changes to the template, a dialogue box asks if "Do you want to update all the documents in your local site that use this template" [Note, sometimes this box WILL NOT appear if you have not attached your template to anything yet]. Usually, the answer is "yes". After all, that is the point of creating a template. Note you'll need to re-upload each page in your site that you have changed.

Last update: February 14, 2005 (JEM)