
483
Tem pl at es
Last updated 6/3/2015
More Help topics
Modify template properties
Types of template regions
Modify template properties
Modify template properties
Template expressions
Defining editable tag attributes in templates
Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the
options described in this article in Dreamweaver CC and later. For more information, see this article.
Specify editable tag attributes in a template
You can allow a template user to modify specified tag attributes in a document created from a template.
For example, you can set a background color in the template document, yet enable template users to set a different
back
ground color for pages they create. Users can update only the attributes you specify as editable.
You can also set multiple editable attributes in a page so that template users can modify the attributes in template-based
doc
uments. The following data types are supported: text, Boolean (true/false), color, and URL.
Creating an editable tag attribute inserts a template parameter in the code. An initial value for the attribute is set in the
tem
plate document; when a template-based document is created, it inherits the parameter. A template user can then
edit the parameter in the template-based document.
Note: I
f you make the link to a style sheet an editable attribute, then the attributes of the style sheet are no longer available
for
either viewing or editing in the template file.
1 In the Document window, select an item you want to set an editable tag attribute for.
2 Select Modify > Templates > Make Attribute Editable.
3 In the Attribute box, enter a name or select an attribute in the Editable Tag Attributes dialog box by doing one of the
following:
• If the attribute you want to make editable is listed in the Attribute pop-up menu, select it.
• If the attribute you want to make editable isn’t listed in the Attribute pop-up menu, click Add, and in the dialog
b
ox that opens, enter the name of the attribute you want to add, then click OK.
4 Make sure the Make Attribute Editable option is selected.
5 In the Label box, enter a unique name for the attribute.
At the location where the optional region is inserted, code similar to the code below appears:
<!-- TemplateParam name="departmentImage" type="boolean" value="true" -->
Do Not Use<!-- TemplateBeginIf cond="departmentImage" -->
<p><img src="/images/airfare_on.gif" width="85" height="22"></img> </p>
<!-- TemplateEndIf -->
You can access and edit template parameters in the template-based document.
Kommentare zu diesen Handbüchern