This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrade your browser?

Adobe Dreamweaver CS3

Templates: Applying Templates

To keep a site looking consistent, use templates for pages with a similar content or layout design. Dreamweaver allows you to create blank pages from templates to which you add text or you can apply a template to a page which already contains text and elements. Dreamweaver also allows you to detach a template from a page without affecting any of the page's contents.

NOTE: This document assumes that you have already created a template. If you have not done so, please refer to Creating a New Template.

return to topCreating a New Template-Based Page

Creating a new template-based page is very similar to creating a new page or template. If you have not yet created a template, please refer to Creating a New Template.

  1. From the File menu, select New...
    The New Document dialog box appears.

  2. From the Categories list, select Page from Template
    New Document dialog box: Template

  3. In the Site scroll box , select the site that contains the template on which you would like to base your new page
    NOTE: You may have only one site listed in this box.

  4. In the Template for Site ("the desired site") scroll box, select the template

  5. Click CREATE
    The new page is created.

return to topApplying a Template to Existing Pages

Templates can be applied to web pages that have already been 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 based on a template, there will be no region names associated with it. Therefore, when Dreamweaver scans the page for region names, a mismatch will occur. Without a region name, Dreamweaver is unsure as to where the existing content of the page should be placed. To remedy this situation, you will need to select what region the page's content shall be moved to.

  1. Open the web page to which the template is to be applied

  2. From the Modify menu, select Templates » Apply Template to Page...
    The Select Template dialog box appears.
    Select Template dialog box

  3. From the Site pull-down list, select the site where the template is located

  4. In the Templates scroll box, select the template you wish to apply to the page

  5. Select Update Page when template changes
    NOTE: This option is selected when the checkbox is checked.

  6. Click SELECT
    The Inconsistent Region Names dialog box appears.
    Inconsistent Region Names dialog box

  7. Under Name, select Document body

  8. From the Move Content to New Region pull-down list, select an editable template region 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.

  9. Select Document head

  10. From the Move Content to New Region pull-down list, select Head
    NOTE: This allows you to preserve META tags, cascading style sheets, and other special header content from your original page after the template has been applied.

  11. Click OK
    The template is applied.

return to topDetaching 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 will not be applied to the page after it is detached. Templates can always be re-applied to a page.

  1. Open the web page you wish to detach from a template

  2. From the Modify menu, select Templates » Detach from Template
    The web page is detached from the template.

Excellence. Our Measure. Our Motto. Our Goal.