Nesting Templates


One last element of templates that we need to cover is the nesting of templates inside one another. To nest a template, you would create a primary template, and then create a child page based on that template and save it as a secondary template. This secondary template is then nested inside the primary template and any changes that are made to the primary template are not only propagated out to child pages based on the primary template, but also affect the secondary template and any child pages based on the secondary template.

Sound confusing? Let's look at a scenario that might occur in the real world and it should get a little clearer. Suppose that Retro's Cycles asked you to design a set of pages that their administrative assistant could update. They don't want her to be able to change the site layout, but they'd like her to be able update content and maybe add a few photos. Sounds like a good opportunity for a template, right? So, you'd create a template with an editable region that would allow the administrative assistant to edit the content in only that region. Pretty straightforward.

But what happens when the company wants to allow the sales manager to update the details of the various used motorcycles for sale in the "For Sale" section of the site? They want the administrative assistant to update the general copy for the rest of the site, but the sales manager should be the one updating the pages in the For Sale section.

The way to accomplish this is to create a series of child pages from the original template and save them as the pages for the site. The admin can access each of the editable regions for these pages. The second step, however, is to save the For Sale page as a template and then spawn child pages from that secondary template. The service manager can then be sure that his pages retain the look and feel of the For Sale section and he can update the pages as necessary.

As you can see, nested templates can get very complicated, very quickly. For that reason, put some serious thought into whether or not they are something you want to use. Although they can be a good tool for ensuring consistency across your site, they can get very difficult to manage as the number of nested templates you use grows.



Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

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