|
Templates- An
Overview
Dreamweaver templates are a great way to keep
pages in your site consistent. Not only will all your pages have
a similar look, but they will also be easy to
update. Templates are created in a way similar to creating
web pages. The template should be representative of the layout
and formatting of the pages that will be based on it. Once the
template is created, new pages can be based on that template.
For information on creating templates, see
Creating Templates. If you have existing pages in your site,
you may also
apply the template to those pages.
One of the main advantages to using a Dreamweaver template is
it allows you to make a change on the template and then choose whether you
would like Dreamweaver to automatically make the same change on all
documents based on the template. For information on automatically updating
pages, see
Updating Pages Based on a Template.
Template Regions
Dreamweaver templates consist of regions. When creating a
template you have two types of regions available: locked and unlocked. As
you work on pages based on the template, these regions determine whether you
can edit content. When editing a template or a template-based page in
Dreamweaver, template regions are enclosed by a teal box with a tab at the
top that displays the region name. For information on inserting regions, see
Creating Templates.

Locked Regions
Locked regions do not allow changes to be made to content in
that area on a template-based page. Dreamweaver templates have three types
of locked regions: a locked region, a repeating region, and an optional
region. When changes are made to a locked region of a template, you have the
option of applying the change to all pages based on that template. This
works very well for making changes to information that appears on every page
(e.g., contact information).
-
Locked Region
-
All elements placed into a Dreamweaver template, by
default, are locked (i.e., a template can be considered one big locked
region). The content of a locked region cannot be modified when working on
a template-based page. The template must contain an
unlocked region in order for content in that region to be edited when
working on template-based pages.
-
Repeating Region
-
Repeating regions help ensure consistency between sections
of a web page that repeat. For example, if a template contains a table row
that is designated as a repeating region, that row can be repeated in
template-based pages as content is added to the table.
NOTE: In order for the repeating region to be editable, an
editable region must be placed within the
repeating region.
-
Optional Region
-
An optional region is used to control page content that may
or may not be displayed. This type of region can be displayed when a
certain condition--set in the template--is true or false. For example, if
the current month is December, an optional region may be
displayed containing the text Happy Holidays.
Unlocked Regions
Unlocked regions give full control over content in that area
on a template-based page. There are two unlocked regions available in
Dreamweaver: an editable region and an editable optional region.
-
Editable Region
-
Editable, or unlocked, regions allow content to be edited
within the region in a template-based page. It is imperative that a
template contains a minimum of one editable region; otherwise, pages based
on the template will not be editable.
-
Editable Optional Region
-
An editable optional region allows content changes in an
optional region. If the optional region
contains text and images, then you can choose whether or not to include
the region in the web page, as well as edit all elements of the text and
images. For example, a table that contains information about what's new on
a website could be placed in an editable optional region. This way, when
additions are made to the website, the table can be displayed as well as
edited. If there are no additions, the table can be hidden.
|