Operation Manual
367
USING DREAMWEAVER
Creating and managing templates
Last updated 3/28/2012
An optional region A section of a template that holds content—such as text or an image—that may or may not appear
in a document. In the template-based page, the template user usually controls whether the content is displayed.
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 template user set the
alignment to left, right, or center.
More Help topics
“Editing content in a template-based document” on page 393
“Creating editable regions in templates” on page 377
“Creating repeating regions in templates” on page 378
“Using optional regions in templates” on page 381
“Defining editable tag attributes in templates” on page 383
Links in templates
When you create a template file by saving an existing page as a template, the new template in the Templates folder, and
any links in the file are updated so that their document-relative paths are correct. Later, when you create a document
based on that template and save it, all the document-relative links are updated again to continue to point to the correct
files.
When you add a new document-relative link to a template file, it’s easy to enter the wrong path name if you type the
path into the link text box in the Property inspector. The correct path in a template file 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.
Ensure that the correct paths for links exist by using either the folder icon or the Point-to-file icon in the Property
inspector when creating links in templates.
Dreamweaver 8.01 link update preference
Previous to Dreamweaver 8 (that is, Dreamweaver MX 2004 and earlier), Dreamweaver did not update links to files
that resided in the Templates folder. (For example, if you had a file called main.css in the Templates folder, and had
written href="main.css" as a link in the template file, Dreamweaver would not update this link when creating a
template-based page.)
Some users took advantage of the way Dreamweaver treated links to files in the Templates folder, and used this
inconsistency to create links that they intentionally did not want to update when creating template-based pages. For
example, if you are using Dreamweaver MX 2004, and have a site with different folders for different applications—
Dreamweaver, Flash, and Photoshop. Each product folder contains a template-based index.html page, and a unique
version of the main.css file at the same level. If the template file contains the document-relative link href="main.css"
(a link to a version of the main.css file in the Templates folder), and you want your template-based index.html pages
also to contain this link as written, you can create the template-based index.html pages without having to worry about
Dreamweaver updating those particular links. When Dreamweaver MX 2004 creates the template-based index.html
pages, the (un-updated) href="main.css" links refer to the main.css files that reside in the Dreamweaver, Flash, and
Photoshop folders, not to the main.css file that resides in the Templates folder.