Dreamweaver: Templates
Dreamweaver comes with some features designed to help you avoid
repeating your work. The most useful of these is the Template
feature, which allows you to use a single template file that
Dreamweaver keeps updated on all your pages.
Templates are files that are "applied" to other documents.
Dreamweaver keeps track of which documents use which template and
updates them for you. The advantage to such templates is that you can
use them to give a consistent look to your site without having to
waste a lot of time repeating the same code over and over.
Make a template
- Make a page that you want to be your template. Make all the
parts of the page that you want to be fixed, then decide which parts
you want to be alterable.
- Once you've made your page that will serve as a template, click
"File" and choose "Save as Template...." A dialog window will open,
asking what you want to name your template (below).
Dreamweaver Save Template Dialog
- Now place your cursor in one of the areas you want to be an
"editable area." Click the "Modify" window, select the "Templates"
submenu, and choose "New Editable Region." A dialog window will open,
asking what you want to name the editable area (below).
Dreamweaver New Editable Region Dialog
Use a Template
- Open a new document by clicking "File" and then selecting "New
from Template...." Dreamweaver will ask you which template you want
to use.
OR
- Apply a template to an existing document by opening that
document, clicking "Modify," selecting the "Templates" submenu, and
choosing "Apply Template to Page...." A dialog window will open,
asking which template you want to use. Dreamweaver will also help you
move the content from your page into the "editable" sections of your
template. Save and you are ready to go.
Edit a template
- Open your template as if it were a normal web document. Edit and save your changes.
- When you save your changes, Dreamweaver will ask if you want to
update your files (below). Clicking "Update" will change all the
files that draw from that template.
Dreamweaver Update Files Dialog
Using templates can be an efficient and handy way to manage your
web pages. The only down side is that editing template pages by hand
can be a real bother.
Back