Using Dreamweaver

Dreamweaver MX Tutorial

Created and designed by Vivienne Trulock for ilikecake, 2005

Templates

Templates are a way of maintaining the consistency of your site. All the pages look the same and it is relatively easy to make changes to the whole site. To make a template you first need to design the page layout as a normal web page. As luck would have it, I have a premade sample template.

Exercise - make a template

Open up the premade sample template and save it into your site folder. This will become our template.

Open the file in Dreamweaver and go to 'File > Save As Template'. This saves the file as template.dwt, and automatically creates a template folder in your site. The .dwt extension stands for DreamWeaver Template. These files are used for design and update purposes only. They are never uploaded as part of a website.
save as template

When using templates you have to set unlocked regions so that not all the pages are the same. Highlight the header and paragraph text, (but not the navigation or copyright information as we want this to be identical on every page). Right-click and select 'Templates > New Editable Region' and give the area a name - para1.

templates new editable region

You can now see the editable regions names. The doctitle is automatically done for you so that you can change the title of each page.
editable regions

So that's how to make a template. The next step is to make a page based on the template.

Exercise - use a template

To make a page that's linked to a template, go to 'File > New' and select the 'Template' tab, select the template and click 'Create'.

templates tab

You'll notice that you can only modify the editable regions, ie para1 and doctitle. The rest of the template is 'stuck'. This can only be modified in the original template (.dwt) file. Change the content of the paragraph and give the page a title.

What if I want to make changes to my template? No problem!

Exercise - change a template

First open up template.dwt that you made earlier.
open template file

Next, make any changes you like to the template. Changes made in the editable regions will not occur in the attached pages. Any changes outside the editable regions will occur in the attached pages once they have been updated.

Save the changes - 'File > Save'. You will be asked if you want to update the changes in any files which use that template. Click on 'Update'.
update pages

Check the file linked to the template to make sure the changes worked.