Managing Your Site
 with Dreamweaver
      by Brian Sullivan



Using Templates


Making a page from a Template

At this point, you can either create a new page from a Template or you can apply a Template to an existing page. In other words, you may already have your content in some basic HTML pages. All you want to do is to apply the GUI. This is where applying a Template to a page comes in.

One advantage to applying a Template to an existing page is that any scripts or behaviors that are unique to the page will remain in the HEAD section after applying. This is different than trying to add a behavior to a page created from and attached to a Template. In that case, new behaviors must be added to the Template.

  Often, after build out has been going along, we come to a page where a behavior needs to be added. Take the content out and place it into a new HTML page. Add your behavior and attach the Template.  


Making A New Page From A Template

Choose File > New from Template. In the dialog box that appears, choose the template of choice.

If you don't want your new document to update when the template changes, deselect Update Page When Template Changes. This is the about the same as detaching it from the Template!

Applying A Template To An Existing HTML Document

  1. Open up your document, ( for the lab, open up template-applying-to-existing-page.htm ).
  2. Choose Modify > Templates > Apply Template to Page. Choose a template from the list and click select.
    You can also select a Template from the Assets window (F11) or by dragging the Template to the document from the assets window.
  3. A Window may appear asking where to place orphaned content. Since your page has no editable regions it needs to know in which editable region of the Template you wish to place the new material. In the lab example, choose content.
  4. Choosing none will discard the orphaned content.
  5. If you are applying a new Template to a page with an existing Template, you will be asked again to place the Orphaned content. There for your new Template should have the same editable regions as the old Template. Otherwise, it will be discarded or placed into the wrong area!

The last point is where Dreamweaver can be very powerful. A Site can be redesigned with a new look and if things have been done right, you could possibly change the entire Site, no matter how many pages, in minutes! We will also look at Site change through Template modifications next.

Remember the editable regions!




    © 2001 Brian Sullivan. All Rights Reserved
e-mail the author, Brian Sullivan