University of Minnesota Duluth People | Departments | Search UMD
ITSS
Search ITSS:

Creating and Applying a Template

A template allows the combination of redundant items to be used easily over and over again. The server-side includes for header and footer, and the library object for the navigational links are part of my Dreamweaver Management Tools workshop template. When I created this page (and all the others) I called up the template I created and stuck the content in it. Everything else was already there.

So what? I could also do that using the "Save As..." command and a generic page. This is true, but when I make a change to the template I can update any page that was created with that template automatically. Try that the other way!

If you're not convinced, how about applying a template to an existing page? That's right! Delete the stuff you don't want on your current page, apply the template and you're done.

Still not enough? I can also mark sections of the template as being uneditable, meaning I can't accidentally erase the redundant stuff unless I go back to the original template and change the item.

Create a Template

Let's make a template using the ssi and library object created earlier.

  1. Go to the "File" menu
  2. Choose "New"
  3. Make the title of the page "Place Your Title Here"
  4. Insert the ssi "viSSI.html"
  5. Insert the library object "Local Event Text"
  6. Go to the "File" menu
  7. Choose "Save as Template..."
  8. Name the file "FirstTemplate.dwt"

Mark Region as Editable

By default, everything in a template is uneditable except for the page title. To make a region editable, it needs to be selected first.

  1. Click in between the ssi and library object in the page
  2. Go to the "Modify" menu
  3. Choose "Templates>New Editable Region..."
  4. Name the region "Content"
  5. Click "OK"
  6. Save the template

You should now see

{Content}

in your page. This will be an editable region in any page made from this template, and the ssi and library object will not be editable.

Other regions may also be created to suit your design layout.

Use a Template

Make a New Page from a Template

  1. Go to the "File" menu
  2. Choose "New from Template..."
  3. Pick "FirstTemplate"
  4. Click "Select"
  5. Put the following text in the {Content} region

Try editing the highlighted areas. If all is working well, you can't.

Apply a Template to an Existing Page

To see how this is done, open the file "ApplyToMe.html" from the example web site folder.

  1. Go to the "File" menu
  2. Choose "Open..."
  3. Locate the example web site folder (ExampleWebSite)
  4. Open ExampleWebSite
  5. Open "docs_for_exercises"
  6. Open the file "ApplyToMe.html"
  1. Go to the "Modify" menu
  2. Choose "Templates>Apply Template to Page..."
  3. Pick "FirstTemplate"
  4. Click "Select"

Dreamweaver will prompt you for where you want your existing content to go. You get 3 guesses!

When you're ready, move on to "Find and Replace."

Dreamweaver Management Tools Navigational Links

  1. Dreamweaver Management Tools Workshop
  2. Defining a Site
  3. Server-Side Include (SSI) and Library Object
  4. Making and Applying a SSI
  5. Making and Applying a Library Object
  6. Creating and Applying a Template
  7. Find and Replace
  8. Web Design References
Did you find what you were looking for? YES NO
©2003 Regents of the University of Minnesota. All rights reserved.
The University of Minnesota is an equal opportunity educator and employer.
Last modified on 04/22/02
Contact ITSS | Privacy