Creating Editable Tag Attributes


Editable tag attributes allow you to define tags that can be changed in the subsequent documents based on the original template.

1.

In the teacher template, teacher.dwt, select the table that contains the teacher image and bio.

Tip

Click the outer border of the table to select it.

The Document window outlines the table to show that it is selected.

2.

Choose Modify > Templates > Make Attribute Editable.

The Editable Tag Attributes dialog box opens.

3.

In the Editable Tag Attributes dialog box, click the Add button and type BGCOLOR as the Attribute. Click OK and note the attribute is added to the Attribute menu.

The BGCOLOR attribute does not appear in this menu only because a background color was not defined for the table. For an attribute to appear, you must set that attribute initially. The other attributes listed are WIDTH, BORDER, CELLPADDING, and CELLSPACINGall properties of the table that were defined.

Note

Attribute names must be typed in uppercase. Adding an attribute yourself requires you to be familiar with HTML tags and their attributes. You can use the Reference panel to learn more about tags and their attributes. For example, if you select TD in the Tag menu on the Reference panel, you can learn about that tag's attributes by clicking the Description menu and selecting one of the tag attributes, such as bgcolor. You'll learn more about HTML and the Reference panel in Lesson 16.

4.

Click the Make attribute editable checkbox. Set the Label text to bgcolor; choose Color for the Type, #FFFFFF for Default, and click OK. Save the teacher template, click Update, close the Update Pages dialog box, and close the template file teacher.dwt.

When you click the Make attribute editable checkbox, the value of the attribute is inserted into the table tag as it is defined in the template.

The Editable Tag Attributes dialog box closes. The background color of the table is now an editable tag attribute. The teacher.dwt template might not display as expected if you preview it in the browser after making the bgcolor attribute editable. For Dreamweaver to create the necessary template markup that allows it to control all documents based on the template, the code displayed in the Bgcolor text field is @@(bgcolor)@@. This kind of markup is necessary for the template to function, and it doesn't cause viewing irregularities in the final documents that are based on the template.

Note

To relock a tag that has previously been defined as editable, you must select the tag and choose Modify > Templates > Make Attribute Editable. Select the attribute you want to lock from the Attribute drop-down menu and uncheck the Make attribute editable checkbox.





Macromedia Dreamweaver 8(c) Training from the Source
Macromedia Dreamweaver 8: Training from the Source
ISBN: 0321336267
EAN: 2147483647
Year: 2006
Pages: 326

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net