Operation Manual

368
USING DREAMWEAVER
Creating and managing templates
Last updated 3/28/2012
In Dreamweaver 8, however, this behavior was changed so that all document-relative links are updated when creating
template-based pages, regardless of the apparent location of the linked files. In this scenario, Dreamweaver examines
the link in the template file (href="main.css") and creates a link in the template-based page that is relative to the location
of the new document. For example, if you are creating a template-based document one level up from the Templates
folder, Dreamweaver would write the link in the new document as href="Templates/main.css". This update in
Dreamweaver 8 broke links in pages created by those designers who had taken advantage of Dreamweaver’s former
practice of not updating links to files in the Templates folder.
Dreamweaver 8.01 added a preference that enables you to turn the update relative links behavior on and off. (This
special preference only applies to links to files in the Templates folder, not to links in general.) The default behavior is
to not update these links (as in Dreamweaver MX 2004 and before), but if you want Dreamweaver to update these kinds
of links when creating template-based pages, you can deselect the preference. (You would only do this if, for example,
you had a Cascading Style Sheets (CSS) page, main.css, in your Templates folder, and you wanted a template-based
document to contain the link href="Templates/main.css"; but this is not recommended practice as only Dreamweaver
template (DWT) files should reside in the Templates folder.)
To have Dreamweaver update document-relative paths to non-template files in the Templates folder, select the
Templates category in the Site Setup dialog box (it’s under Advanced Settings), and deselect the Don’t Rewrite
Document Relative Paths option.
For more information, see the Dreamweaver TechNote on the Adobe website at www.adobe.com/go/f55d8739.
More Help topics
Link to documents using the Point-To-File icon” on page 261
Document-relative paths” on page 258
Server scripts in templates and template-based documents
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 are not 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 are not copied. An alert warns you if you change 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 in a template, changes to scripts before the <html> tag or after the </html> tag are copied to
documents based on that template. However, you will no longer be able to edit those scripts in documents based on
the template. Thus, you can choose to either edit these scripts in the template, or in documents based on the template,
but not both.
Template parameters
Template parameters indicate values for controlling content in documents based on a template. Use template
parameters for optional regions or editable tag attributes, or to set values you want to pass to an attached document.
For each parameter, you select a name, a data type, and a default value. Each parameter must have a unique name that
is case sensitive. They must be one of five permitted data types: text, boolean, color, URL, or number.