DREAMWEAVER 8
 
» Navigation
 
L E S S O N S
> Templates
> Rollovers
> XHTML
> CSS
E L E M E N T S
> Menu
> Library
> Panels
> File Menu
> Templates
> Editing Text
> Page Elements
>
L I N K S
> Tutorial
> Templates
> webmonkey

> communitymx
H O M E
computerschool.net


 
» Lessons & Exercises
1 Creating a Dreamweaver template

Select File > Save as Template.

NOTE
Unless you selected Don’t Show This Dialog Again in the past, you’ll receive a warning that says the document you’re saving has no editable regions. Click OK to save the document as a template.
The Save As Template dialog box appears.
Enter a unique name for the template in the Save As text box. Click Save.
Dreamweaver saves the template file in the site’s Templates folder in the local root folder of the site, with a
.dwt filename extension. If the Templates folder does not already exist in the site, Dreamweaver automatically creates it when you save a new template.

NOTE
Do not move your templates out of the Templates folder, or put any non-template files in the Templates folder. Also, do not move the Templates folder out of your local root folder. Doing so causes errors in paths in the templates.

2 Inserting an editable region

Before you insert an editable region, you should save the document you are working in as a template.
You can place an editable region anywhere in your page, but consider the following if you are making a table or a layer editable:
You can mark an entire table or an individual table cell as editable, but you can’t mark multiple table cells as a single editable region. If a <td> tag is selected, the editable region includes the region around the cell; if not, the editable region affects only content inside the cell.
Layers and layer content are separate elements; making a layer editable lets you change the position of the layer as well as its contents, but making a layer’s contents editable lets you change only the content of the layer, not its position.

To insert an editable template region:
In the Document window, do one of the following to select the region:
Select the text or content that you want to set as an editable region.
Place the insertion point where you want to insert an editable region.
Do one of the following to insert an editable region:
Select
Insert > Template Objects > Editable Region.
Right-click (Windows) or Control-click (Macintosh), then select Templates > New Editable Region.
In the Common category of the Insert bar, click the arrow on the Templates button, then select Editable Region.
The Editable Region dialog box appears.
In the Name text box, enter a unique name for the region.  Click OK.

The editable region is enclosed in a highlighted rectangular outline in the template, using the highlighting color that is set in preferences. A tab at the upper-left corner of the region shows the name of the region. If you insert an empty editable region in the document, the name of the region also appears inside the region.

3  

Applying template

You can apply a template to an existing document using the Assets panel or from the Document window. You can undo a template application if necessary.

To apply a template to an existing document using the Assets panel:
Open the document you want to apply the template to.
In the Assets panel (Window > Assets), select the Templates category on the left side of the panel.
Do one of the following:
Drag the template you want to apply from the Assets panel to the Document window.
Select the template you want to apply, then click the Apply button at the bottom of the Assets panel.
If content exists in the document that can’t be automatically assigned to a template region, the Inconsistent Region Names dialog box appears.

If you have unresolved content, select a destination for the content, then click OK.
For information about moving existing content to editable regions in the document, see Resolving inconsistent region names.

To apply a template to an existing document from the Document window:
Open the document you want to apply the template to.
Select
Modify > Templates > Apply Template to Page.
The Select Template dialog box appears.

Choose a template from the list, then click Select.
If content exists in the document that can’t be automatically assigned to a template region, the Inconsistent Region Names dialog box appears.

If you have unresolved content, select a destination for the content, then click OK.
For information about moving existing content to editable regions in the document, see Resolving inconsistent region names.

To undo the template changes:
Select Edit > Undo Apply Template.
The document reverts to its state before the template was applied.

Homework:
  • Create a separate temporary folder (eg. "testing_template")
  • Open Dreamweaver as a new site in this folder.
  • Create simple table layout with inserted navigational table.
  • Save it as a template and insert editable region.
  • From your template create a few simple pages to simulate a website, saving them as html documents.
  • Apply every page to your template
  • Open template and make changes to non editable region (eg. navigational table) and save it.
  • See if other pages were updated.