<img src="../files/images/webdesign.gif" width="405" height="144">

Parkland College > Fine & Applied Arts > Graphic Design | Web Design >
Student Links > GDS 214 > Dreamweaver Templates

 

GDS 214 WEB DESIGN II
Dreamweaver Templates
Instructor: Rob Higgins

1 > 2 > 3 > 4 > 5 > 6 > 7 > 8> 9 > 10 > 11 > 12 > 13

Next >

 

Creating a template:

About Dreamweaver templates

A Dreamweaver template is a special type of document that you use to design a “locked” page layout. A template author designs the page layout, and creates regions in the template that are editable in documents that are based on a template. In a template, the designer controls which page elements a template user— such as writers, graphic artists, or other web developers— can edit.

One of the most powerful uses of templates is the ability to update multiple pages at once. A document that is created from a template remains connected to that template (unless you detach the document later). You can modify a template and immediately update the design in all document based on it.

A template controls the editable and fixed regions of a document based on a template. There are several types of template regions that you can include in a document.

You can add a Cascading Style Sheet (CSS), timeline, or behavior to a document that is based on a template, because Dreamweaver automatically inserts an editable region in the head section of a document.

Template-related operations (such as adding editable regions) are enabled in both Code view and Design view. Some template customizing options are only available in Code view.

If you want to store additional information about a template (such as who created it, when it was last changed, or why you made certain layout decisions), you can create a Design Notes file for the template. Documents based on a template do not inherit the template’s Design Notes.

 

 

About defining template regions

A template determines the basic structure for a document and contains elements such as text, images, page layout, styles, and editable regions.

Dreamweaver automatically locks most regions of a document when you save the document as a template. As a template author you define which regions of a template-based document will be editable by inserting editable regions or editable parameters in the template.

As you create the template, you can make changes to both editable and locked regions. In a document based on the template, however, a template user can make changes only in the editable regions; the locked regions can’t be modified.

There are four types of template regions:

  1. editable regions
  2. repeating regions
  3. optional regions
  4. editable tag attributes.

An editable region is an unlocked region in a template-based document; a section a template user can edit. A template author can define any area of a template as editable. For a template to be effective, it should contain at least one editable region; otherwise, pages based on the template can’t be edited.

A repeating region is a section in a document that is set to repeat. For example, you can repeat a table row. By repeating the table row, you allow the template user to create an expanding list, while keeping the design under the control of the template author. In a document based on the template you use repeat region control options to add or delete copies of the repeated region.

There are two types of repeating regions you can insert in a template:

  1. repeating region
  2. repeating table

An optional region is a section of a template that a designer defines as optional, to hold content such as optional text or an image which may or may not appear in a document based on the template.

In the template-based page, the content editor usually controls whether the content shows or not.

An editable tag attribute lets you unlock a tag attribute in a template, so the attribute can be edited in a template-based page. For example, you can “lock” which image appears in the document but let the page author set the alignment to left, right, or center.

 

 

About template parameters

You can use template parameters to define optional regions, editable tag attributes, or to set values you want to pass to an attached document.

Creating a template parameter lets you define values for controlling content in documents based on a template. For each parameter you define a name, a data type, and a default value. Each parameter must have a unique name and is case sensitive.

Template parameters are passed to the document as instance parameters, and can be accessed by the Modify > Template Properties command. In most cases, a template user can edit the parameter’s default value to customize what appears in a template-based document. In other cases, the template author might use a computed-text expression to determine what appears in the document, based on the value in the expression.

Editing code outside of HTML tags

Some server scripts are inserted at the very beginning or end of the document (before the <html> tag or after the </html> tag). Such scripts require special treatment in templates and template-based documents. Normally, if you make changes to script code before the <html> tag or after the </html> tag in a template, the changes will not be copied to documents based on that template. This can cause server errors if other server scripts, within the main body of the template, depended on the scripts that were not copied. As a result, Dreamweaver warns you if you make a change to scripts before the <html> tag or after the </html> tag in a template.

To avoid this problem, you can insert the following code in the head section of the template:

<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->

When this code is present in a template, changes to scripts before the <html> tag or after the </html> tag will be copied to documents based on that template. However, you will no longer be allowed to edit those scripts in documents based on the template. Thus, you can choose to be able to edit these scripts in the template, or in documents based on the template, but not both.

About links in templates

To create a link in a template file, use the folder icon or the Point-to-File icon in the Property inspector; don’t type in the name of the file to link to. If you type the name, the link might not work. This section explains how Dreamweaver handles links in templates.

When you create a template file from an existing page, then save that page as a template, Dreamweaver updates the links so they point to the same files as before. Because templates are saved in the Templates folder, the path for a document-relative link changes when you save the page as a template. In Dreamweaver, when you create a new document based on that template and save the new document, all the document-relative links are updated to continue to point to the correct files.

When you add a new document-relative link to a template file, however, if you type the path into the link text box in the Property inspector, it’s easy to enter the wrong path name. The correct path is the path from the Templates folder to the linked document, not the path from the template-based document’s folder to the linked document.

Note: In some cases, (such as file paths in event handlers in templates) you can’t use the folder icon or the Point-to-File icon; in those cases, you must enter the correct path name.

1 > 2 > 3 > 4 > 5 > 6 > 7 > 8> 9 > 10 > 11 > 12 > 13

Next >

 

 

______________________________

Last updated: 11/08/03• Webmaster: Paul Young

 

 

Tips, Tricks
& Handouts

Student
Links