|
Templates-
Applying Templates
To keep your site looking consistent, you may
decide to implement templates after you have created some pages.
Dreamweaver allows you to apply templates to pages with existing
content. This document contains instructions on the following:
Creating
a New Template-Based Page
Creating a new template-based page is very similar to
creating a new page or template.
-
From the File menu, select New...
The New Document dialog box appears.
-
Select the Templates tab
-
In the Template For scroll box, select the site
that contains the template you would like to base your new page on
NOTE: You may have only one
site listed in this box.
-
In the Site "site name" scroll box, select the
template
-
Click CREATE
The new page is created.
-
Begin adding page content
Applying
a Template to Existing Pages
Templates can be applied to web pages that you have already
created. When a template is applied, Dreamweaver scans the page for region
names (for more information about regions, see
Templates: An Overview). Since the page is not currently based on a
template, there are no region names in the page. Therefore, when Dreamweaver
scans the page for region names, a mismatch occurs. Dreamweaver does not
know what template region the existing content of the page should be placed
in. You will then select the editable region of the template in which to
place the existing content of the web page.
-
Open the web page you wish to apply the template to
-
From the Modify menu, select Templates
» Apply Template to Page...
The Select Template dialog box appears.
-
From the Site pull-down list, select the site
where the template is located
-
In the Templates scroll box, select the template
you wish to apply to the page
-
Select Update Page when
Template Changes
-
Click SELECT
The Inconsistent Region Names dialog box appears.

-
Select Document body
-
From the Move Content to New Region pull-down
list, select an editable template region you wish to place the existing
page content into
NOTE: All existing page
content will be placed into this region. After the template has been
applied, you can move portions of the existing content into other editable
regions of the template.
-
Select Document head
-
From the Move Content to New Region pull-down
list, select Head
NOTE: This allows you to
preserve META tags, cascading style sheet, and other special header
content from your original page after the template has been applied.
-
Click OK
The template is applied.
Detaching
a Page from a Template
If you no longer want a web page to be based on a template,
you can detach the page from the template. The page will not lose any
content; however, changes made to the template cannot be applied to the page
after it is detached. Templates can always be re-applied to a page.
-
Open the web page you wish to detach from a template
-
From the Modify menu, select Templates
» Detach from Template
The web page is detached from the template.
|