A tutorial on using Templates in Dreamweaver
What is a Template?
Most of the web pages that uses a common structure called
a template.
Generally web sites follows a standard structure, that contain
a header, a navigation bar and a footer which is common to
all pages. If your site has 30 pages and if you want to make
a small change, you will have to make changes in each of those
30 pages manually. Instead, if you use a template you only
need to make changes in the template and all other pages get
updated automatically. Following steps will help you to learn
how to use templates in Dreamweaver.
Creating a Template in Dreamweaver
Step 1: Make a web page with basic structure
of the site. This should be common to most of the pages in
your site. Note: Don't put matchless content in this page.
Step 2: Once you created the structure go
to File and click on Save As Template, and save it as a template.
Step 3: Notice the blue bar on top shows
<<Template>>. Now you are in the Template. The
template is automatically saved under a folder called templates.
Note: You can create as many templates as
you like. If you are using different layouts for different
sections of your site you can use different templates for
each of the sections.
Step 4: You can make parts of the template
editable so that you can put content and add information that
is unique to parts of the site. The main content of the pages
will keep changing, so make that area editable. For e.g. the
white space in the middle of the site is clearly an editable
area, as this content is unique to each page.
To make an area editable, locate your cursor on that area,
then go to Modify/Template/New Editable Region, give a suitable
name and you will notice a light blue with the name of the
editable area in your cursor's location.
You can continue to make changes, try different layouts,
add new stuff etc. in the Template.
Using a Template in Dreamweaver
Once you have made the Template, you need to make sure that
all the pages are using the Template so that when you making
changes in the Template the pages using the Template are getting
updated automatically. Follow the steps to Apply a template
to a page.
Step 1: Once you created a page which will
have the same structure as the template then you can go to
Modify/Template/Apply Template to page
Step 2: Once you applied the specified template
to the page you can see a window 'Choose editable region for
orphaned content', choose the editable region and click OK.
You can see that the template is in yellow and cannot be edited.
The editable region is the only region is editable, which
specified in the template.
Note: You can apply the template before
or after writing any content. But you have to choose an editable
region if you need to do after writing the content.
Updating a Template in Dreamweaver
Once you have made the template and applied it to all the
necessary pages, the last step you need to know is how to
update a template. This is the magic of using Templates.
If you need to make any changes in the basic structure of
the site, you have to do it in the Template. So you can make
the changes and save it. If you applied the Template to any
of your site pages then a message window will ask you to 'Update
Templates used in the following files'. You must click on
Update so that the Template will get updated.
|