Apply a template

You can use templates to create documents for your site that have a common structure and appearance. Templates are useful if you want to make sure that all of the pages in a site share certain characteristics.

Once you apply a single template to a group of pages, you can edit information on all those pages by editing the template and then reapplying it to those pages. While elements unique to each page (such as text describing the item for sale) remain unchanged, common template elements (such as navigation bars) are updated on all of the pages that use the template.

The Olivebranch Catalog page links to several product pages that describe individual products that the company offers for sale. Because each of the product pages uses an identical layout and format, they were created using a single template.

In this section, you'll modify an existing template to modify the product pages it has already been applied to. Then you'll apply a different template to those product pages to reformat them without altering their unique contents.


 
View the product pages

Begin by viewing the completed catalog pages in a browser.

To open the completed Olivebranch Catalog page:

1 Choose File > Open and select cat_main_index.htm.
2 Choose File > Preview in Browser to open the page in a browser window.
3 Click the links for wines, cheeses, mustards, and oils to see sample product pages.
Notice that all product pages share the same navigation bar at the top of the page. In addition to containing links to product pages, the navigation bar includes a link to the main Catalog page and (in the graphics at the far right of the bar) a link back to the Olivebranch home page.
4 Close the browser when you're done previewing the main Catalog page and the product pages it links to.
5 Return to Dreamweaver and choose File > Close to close the completed Catalog page.

Now open the partially complete catalog pages in a browser.

To open the tutorial version of the Catalog page:

1 Move the Site window to the foreground by choosing Window > Site Files.
2 Find DW2_cat_main_index.htm in the list and double-click it to open it in the Document window.
3 Press F12 to preview the tutorial Catalog page in a browser.
4 Click the links for wines, cheeses, mustards, and oils to see the product pages you'll be working with.
As with the completed site, each of the product pages uses the same template, so they look very similar. In this case, however, each page is missing both the link to the main catalog page and the graphic at the top right that links to the Olivebranch home page.
5 After you've explored the links to the product pages, close the browser window.
6 Return to Dreamweaver and choose File > Close to close the main Catalog page.