![]() |
Using Macromedia Dreamweaver MX 2004 |
Templates are specialized files that define the basic design of your web page. Multiple pages can be created using each template, and the pages can easily be updated when the template is changed. Templates are also used when working with Macromedia Contribute.
You create a template that looks the way you want the pages to look. Parts that you don't want to change from one page to the next are marked as 'not editable'; parts that you do want to change are 'editable'. 'Optional' and 'Repeating' areas make it possible to group multiple instances of similar fields. When you want to create a new document using that design, you create a new page with that template specified, then edit the material in the editable regions. When you make changes to the template, Dreamweaver will duplicate them on all the pages using that template.
Templates can also be used to set up starter pages, where changes can be made to all regions and/or the pages are not updated when the template is updated.

Note: when putting a link to a particular page into a template, it's best to use a fully-qualified (http://...) address for that link. Otherwise, you may need to copy the files into the template file to have the links work properly. Graphics used in the Template should appear both in the Template folder and in the root folder of the website.
When you want to be able to have multiple instances of a set of editable regions-- for instance, in a departmental directory page, where you want to have names, office locations and phone numbers for multiple people-- you can place those editable regions inside a 'Repeating Region'.


Repeat for all the pages you want to use that template. (Note: the pages do NOT have to have access to the template when uploaded.
Notes about Templates: Templates are associated with Sites. However, Site setup does not migrate with the LAN space but has to be set up for each computer you use Dreamweaver. Templates are saved in directories with the site. So, if you put the directory you are working with in your LAN space, once you set up the Site on a computer with access to the LAN space, you will be able to use the Templates.
You can combine the editable region and the date functionality to set up pages to have a last updated date that automatically updates itself whenever that particular page is updated.
Sometimes you may create a page with a template but not want to keep the 'template' areas sacrosanct and linked to the template. To detach the page from the template, from the Modify menu, choose Templates, then Detach from Template.
To change the template that a page uses, or apply a template to an existing page, go to the Modify menu, choose Templates, then Apply Template to Page.
Choose the template to apply.
If the region names in the new template don't match the region names in the
old template-- or the page didn't previously use a template-- you will be asked
which regions to put the content in:
Click on each region name and in the Move Content to New Region area, choose a region from the drop-down menu. Repeat this for all the regions that say 'Not Resolved'. Then click Ok.
| Back
to Publish |
Back to Table of Contents |
Jennifer Heise, Last updated January 28, 2004