Creating a nested template

Creating a nested template

Nested templates let you create variations of a base template. You create a nested template by saving a document based on a template, then saving that document as a new template. You can nest multiple templates to define increasingly specific layouts. For more information, see Nested templates.

By default, all editable template regions from the base template pass through the nested template to the document based on the nested template. That means that if you create an editable region in a base template, then create a nested template, the editable region appears in documents based on the nested template (if you did not insert any new template regions in that region in the nested template).

In nested templates, pass-through editable regions have a blue border. You can insert template markup inside an editable region so that it won’t pass through as an editable region in documents based on the nested template. Such regions have an orange border instead of a blue border.

To create a nested template:

  1. Create a document from the template on which you want to base the nested template:
    • In the Assets panel’s Templates category, right-click (Windows) or Control-click (Macintosh) the template you want to create a new document from, then select New From Template from the context menu.
    • Select File > New. In the New Document dialog box, click the Templates tab, then select the site that contains the template you want to use; in the document list, double-click the template to create a new document.

    A new document appears in the Document window.

  2. Do one of the following to save the new document as a nested template:
    • Select File > Save as Template.
    • In the Common category of the Insert bar, click the arrow on the Templates button, then select Make Nested Template.

      This is a picture of the feature being described.

    The Save As Template dialog box appears.

  3. Enter a name in the Save As text box, then click OK.

In documents based on the nested template, you can add or change content in editable regions passed through from the base template, as well as editable regions created in the new template.

To prevent an editable region from passing through to a nested template:

  1. In Code view, locate the editable region you want to prevent from passing through.

    Editable regions are defined by template comment tags.

  2. Wrap the editable region (including the comment tags) with the following markers:
    @@(" ")@@
    

    For more information, see TechNote 16416 on the Macromedia website at www.macromedia.com/go/16416.



Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Laying Out Pages with CSS
Managing Templates
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly