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 >
|