Creating Nested Templates


A nested template is one that inherits a master layout from a base template. You can create a base template with the main content that should appear on all pages and then use a nested template to create specific content or a layout style for a certain section in your site. If you have an additional sectionin which you want to use a different layout while keeping the main site components such as main navigation, footer, and headeryou can create another nested template that is also based on your main template. Nested templates are most useful for creating a series of page styles with variations in their layout and design that derive their common content from a main template.

Normally, the process of creating nested templates begins with planning. You will need to first plan the look and feel of the site and create a parent template, then create nested templates for each of the site sections, and finally the sites pages from the nested templates. Typically with nested templates, the parent template is never used to create pages directlyit is used to define a container for the site design with nested templates acting to perform the site page work.

1.

Open the ys-layout.html page in the Lesson_13_Templates folder. Save this file as a template and keep the default name of ys-layout. Click Yes to Update Links.

This page contains the overall look and feel of the Yoga Sangha site. All site pages (except the frame-based pages) can be created from this overall site design. Notice it has two main content areas: mainContent and rightContent. You will create editable regions in these areas so that child templates can define a custom look and feel for each section of the Website.

2.

Place the insertion point inside the main content area. Select the entire area by either selecting the div handle or by using the tag selector to select the <div#mainContent> tag. Choose Insert > Template Objects > Editable Region. Name the region mainContent and click OK.

Note

The div will be active when the insertion point is within the area, but it will not be selected. The small solid squares at the corners and midpoints indicated that the div is selected.

This area is intended to contain the main content for all child pagesthat is, pages that are created from this template.

The editable region tab and visual aids will not appear around divshowever, you can verify that the region has been made editable by looking at the tag inspector, which should read <mmtemplate.editable><div#mainContent>.

3.

Repeat step 2 to create an editable region out of the rightContent area. Name the new editable region rightContent. Save and close the file.

Now that you have created the original Yoga Sangha template, you are ready to create the nested template in the remaining steps.

4.

Choose File > New. From the Templates tab, locate the ys-layout template and click Create.

A new page using the ys-layout template is created. You'll use the ys-layout template as your base template in the next step.

5.

Choose File > Save As Template, name the nested template you are creating ys-teacher, and click Save.

By saving the document you created from the original template as a template itself, you create a nested template. Now that you have created the nested template, you can edit it. Dreamweaver automatically adds the extension .dwt so you don't have to specify it yourself.

Each page in the Teachers section of the site can be created using the ys-teacher template. You can create child templates for each section of the site from the parent ys-layout template.

You must create editable regions in the parent template to make modifications to the child template; you must make editable regions in the child template to edit areas in subsequent pages made from the nested template.




Macromedia Dreamweaver 8(c) Training from the Source
Macromedia Dreamweaver 8: Training from the Source
ISBN: 0321336267
EAN: 2147483647
Year: 2006
Pages: 326

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net