|
|
|
Defining editable tag attributes
You use the Make Attribute Editable command to 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 allow a template user to set a
different background color for pages they create. The user can
update only the attributes you define as editable.
Creating an editable tag attribute inserts a template parameter
in the code. An initial value for the attribute is set in the
template document; when a template-based document is created,
it inherits the parameter. A template user can then edit the
parameter in the document.
Defining editable tag attributes in a template
You can set multiple editable attributes for a page element.
Only tag attributes that are currently set for the element initially
appear in the Attribute pop-up menu. For example, with an image
tag the width and height attributes may be the only ones that
appear in the menu.
If the attribute that you want to make editable isn’t
listed in the Attribute pop-up menu, click Add to add the attribute
to the list.
To define an editable tag attribute:
- In the Document window, select an item you want to set
an editable tag attribute for.
- Choose Modify > Templates > Make Attribute Editable.
- In the dialog box that appears, do 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 box that opens, enter the name of the attribute
you want to add, and click OK.
- Make sure the Make Attribute Editable option is selected.
In the dialog box complete the fields to set the values you
want.
- In the Label text box, enter a unique name for the attribute.
Tip: To make it easier to identify a specific
editable tag attribute later, use a label that identifies
the element and the attribute. For example, you might label
an image whose source is editable logoSrc or label the editable
background color of a body tag bodyBgcolor.
- In the Type pop-up menu, select the type of value allowed
for this attribute by setting one of the following options:
- To let a user enter a text value for the attribute,
choose Text. For example, you can use text with the align
attribute; the user can then set the attribute’s
value to left, right, or center.
- To set the link to an element, such as the file path
to an image, choose URL. Using URL allows Dreamweaver
to automatically update the path used in a link. If the
user moves the image to a new folder, the Update Links
dialog appears.
- To make the color picker available for selecting a value,
choose Color.
- To let a template user type a numerical value to update
an attribute (for example, to change the height or width
values of an image), choose Number.
- The Default Value field displays the value of the selected
tag attribute in the template. Enter a new value in this field
to set a different initial value for the parameter in the
template-based document.
- If you want to make changes to another attribute of the
selected tag, repeat steps 3 through 7.
- Click OK.
Making an editable tag attribute uneditable
A tag previously marked as editable can be marked as uneditable.
Make the change in the template and update the pages derived
from the template.
To reset an editable tag attribute:
- In the template document, click the element associated with
the editable attribute or use the tag selector to select the
tag.
- Choose Modify > Templates > Make Attribute Editable.
- In the Attributes pop-up menu, select the attribute you
want to affect.
- Deselect the Make Attribute Editable checkbox.
- Click OK.
Design View and Code View
Viewing templates in Design view
In template files and documents based on templates, editable
regions appear in the Document window’s Design view surrounded
by rectangular outlines in a preset highlight color.
A small tab appears at the upper left corner of each region,
showing the name of each defined region. Template regions are
also include a highlighted outline. You can make changes to
both editable and locked content.
Template files can be identified by the <<Template>>
title and .dwt file extension in the Document window.
In a document based on a template (a template-based document),
in addition to the editable-region outlines, the entire page
is surrounded by a different-colored outline, with a tab at
the upper right giving the name of the template that the document
is based on. This highlighted rectangle is there to remind you
that the document is based on a template and that you can’t
change anything outside the editable regions.
Note: If you try to edit a locked region in a document based
on a template when highlighting is turned off, the mouse pointer
changes to indicate that you can’t click in a locked region.
|