" />

GDT 150 Design for the Internet: Fall 2001

Using Dreamweaver Templates and Libraries

Templates

Templates are extremely useful when building a site where all the subpages use the same basic layout. If you decide to make layout changes to your site, you can change the template, and all the pages built from that template will change also.

Creating a Template

  1. Create your page as usual, linking all your navigation, designating spaces for content, etc.
  2. Before you put any real content into the framework, save as a template File > Save As Template...
  3. Choose a name for your template. The template will be saved in a new directory in your root folder called "Templates"
  4. Select an area that you want to be able to change from page to page by highlighting it.
  5. Modify > Templates > New Editable Region
  6. Give the editable region a unique name and click OK
  7. Repeat for remaining editable areas.
  8. Save

Common areas that should be editable include content areas, page title graphics, and navigation. People often forget to allow navigation to be editable, but it's important to be able to unlink/ change the selected nav item.

The above method for designating editable areas designates an entire table or table cell as editable. To designate only a portionof a cell, use Modify > Templates > Mark Selection As Editable...

To Create a New Page from a Template

  1. File > New From Template...
  2. Save right away so the paths are calculated properly
  3. Edit the editable areas

To Edit a Template

  1. From the site window, open the Templates directory and double click the template you want to edit..
  2. Edit as you would a normal document
  3. Save
  4. If Dreamweaver prompts you to update documents linked to the template, do so.

Libraries

Libraries contain elements that could be reused over and over again throughout your site. They are particularly useful for something like a copyright notice that changes from time to time.

To Save an Element as a Library Item

  1. Window > Library
  2. Select the element by highlighting it
  3. Click the "New" button on the libary palette
  4. Give the library item a name

To Insert a Library Item

  1. Window > Library
  2. Do one of the following:
    • Drag the item from the library palette to the work space
    • Place your cursor where you want the library item to appear, highlight the library item in the library palette and click the insert button

To Edit a Library Item

  1. Window > Library
  2. Double-click the library item you want to edit. It will open in a new window.
  3. Edit the library item as you would any html document
  4. Save and close. Dreamweaver may prompt to update all documents containing the library item. Click "Update"