Nested Templates


In most cases, templates, combined with the flexibility of editable, optional, and repeating regions, are enough for most web development tasks. In some rare cases, however, single locked regions might be too rigid to be useful. Asume for a moment that Dorknozzle has decided to branch out into four separate companies in support of their four different products (Widgets, Gadgets, Doodads, and Chingaderas). Although the Dorknozzle parent company still wholly owns the four subsidiaries, each of the four companies' websites should have a slightly different look and feel than the parent company. One way of achieving this is to create different templates, one for the parent company site and one for each subsidirate company site that's a slight variation (maybe a different color scheme) of the parent. The downside to this approach is maintainability. If the parent site were to be customized, changes wouldn't trickle down to the four subsidirate sites because they're based on entirely different templates. To fix this problem, we could create a nested template. A nested template works much like the name says: It's a template wrapped within the framework of a second template. In the model we've mentioned above, we could easily solve the maintenance issue by creating a template for our parent company and then create nested templates for our subsidirate sites.

This way, if customizations are made to the parent template, the changes trickle down to all the subsidirate pages. Because nested template development in Dreamweaver isn't all that intuitive, follow these steps to see how they work:

1.

Create a master template as you would normally. That is, create the structure of your site and then choose the Save As Template option from the File menu. In our case, we would simply create the header and logo that represents the main Dorknozzle site and save that as a template.

2.

Insert editable, optional, and repeating regions wherever you want variable content to appear in the template. Save the template when you're ready.

3.

Create a new document based on the template file by choosing the New option from the File menu. Select the defined site from the Templates tab, choose the template option, and click Create.

4.

With the template-derived page open, choose Insert, Template Objects, Make Nested Template. The Save As Template dialog appears.

5.

Enter a name for the nested template and click Save. A new nested template is created.

6.

In the new nested template, make any changes needed to the editable regions. These changes are locked in any document that's based off of this nested template.

7.

Add any new editable, optional, or repeating regions to the nested template. Editable, optional, and repeating regions added to nested templates appear as orange rather than in the default teal color.

8.

Save the file to complete the customization of the nested template.

When you're ready to create template-derived pages from the new template, simply choose the New option from the File menu. Select the defined site from the Templates tab, choose the template, and click Create. You'll be able to customize areas that were set aside as editable within the nested template, not the original parent.




Macromedia Dreamweaver 8 Unleashed
Macromedia Dreamweaver 8 Unleashed
ISBN: 0672327600
EAN: 2147483647
Year: 2005
Pages: 237
Authors: Zak Ruvalcaba

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