University of Rochester

Need Help


Stay Secure

Get Connected

Need Technology?


Incoming Students

Students

Faculty/Staff


Office of the Vice President for IT and CIO

myIdentity

Other IT Resources

IT Notices/Outages

About University IT


University IT Home

University IT » Web Services » Help » Dreamweaver » Templates

Macromedia Dreamweaver - How To


Index | Setup | Starter's Guide | Templates | Tips & Tricks


Dreamweaver Templates

One of the helpful features of Dreamweaver is the ability to create templates to use for all of your pages. Not only will the webpages have similar looks, it makes it easier to update as well. For instance, by using Dreamweaver template, it allows you to make a change on the template and then you have the choice to have Dreamweaver automatically make the same changes for all of the sites based on the same template.

To create the template you can create a new page using the New command in the File menu or opening up a page that has a format you like. Then, choose Save As Template from the File menu. The next step is to mark the regions you want to be able to change on the template as such. When creating a template you have two choices of regions, locked and unlocked. These regions determines where to edit content. Locked regions do not allow changes to be made to content in that area on a template-based page. Unlocked regions give full control over content in that area on a template-based page.

Template regions can be inserted anywhere on the page. Place your cursor where you would like to have the region to appear. Open up the Insert menu and select Template Objects and you will see several options: New Editable Region and Mark Region as Editable. Click on the New Editable Region and in the Name text box, type a name for the template region. Then Click OK. If you mark a region as editable, that text will be in every page you create with that template, but you will be able to change it.

You should also read the University template manual. This provides describes server-side includes that let you update only one page or text file and have all the changes occur on all of the pages. One way many people use the includes is for a navigation menu that is common to many pages. A sample is to have a file called links.txt that contains the following links to pages in your site:

<font size="-2">
<A href="index.html">Home</A><BR>
<A href="about.html">About this Department</A><BR>
<A href="faculty.html">Faculty Members</A><BR>
<A href="events.html">Current Events</A><BR>
</font>
Next, you would put a line that says
<!--#include file="links.txt"--> 

into all of your webpages. What this does is tell the webserver to insert the file "links.txt" into the page from the directory where the file resides. You can also type

<!--#include 
    virtual="/College/Mysite/links.txt">

to make the include directive a little more flexible (if your site was www...edu/College/Mysite/), so your page can insert the links.txt from anywhere else on the webserver.

How to apply a template to an existing page

When you apply a template into an existing page, Dreamweaver scans the page for region names. However, since the existing page is not based on a template, there are no region names in the page. So, you should select the editable region of the template in which to place the existing content of the web page. Open up the page you want to apply a template, from the modify menu, select Templates, then click on Apply Template to Page. From the Site drop down list, select the site the template is located. Then in the Templates drop down menu, select Update page when template changes. Hit select. On the pop up box, you will see "document body", select it. Then Move content to new Region drop down menu, select an editable template region. After that, click on "Document head" and then choose from the Move content to new Region drop down menu as head. Click OK. You are all set.

What about detaching a page from a Template?

This is an easy task. Open the web page you want to detach from template, then click on the Modify menu and select Template, choose Detach from Template. The web page is detached from the template.

 

University Templates

Many users use the University Templates for their web site. Also, here are several of the templates in Dreamweaver template format.

To install these, make a directory called Templates in the folder on your computer where you keep your web pages. Move the downloaded template into this directory, and you should be able to select it when you choose New From Template from the File menu.

When you edit the templates to suit your needs, just open the template file from the Templates directory, make your changes, and then save it.