• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 9. Using Templates > Creating Editable Tag Attributes

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.

In the profile template, profile.dwt, click to place the insertion point in the white space to the right of the first table containing the header, photo, and description editable regions. Select the last <td> tag in the Tag Selector.

The document window now outlines the cell that provides the white background for all the tables you have created by clicking the <td> tag in the Tag Selector.

Choose Modify > Templates > Make Attribute Editable.

The Editable Tag Attributes dialog box opens.

In the Editable Tag Attributes dialog box, select BGCOLOR from the Attribute drop-down menu.

The BGCOLOR attribute only appears in this menu because a background color was defined for the cell (also known as table data or <td>). In order for an attribute to appear, you must set that attribute initially.


If you want to define an attribute as editable, and it is not listed in the Attribute drop-down menu, you can click Add and enter the name of the attribute you would like to add. Attribute names must be typed in uppercase. If you define the attribute first as you did in this exercise, then the Label, Type, and Default settings will be set automatically. Adding an attribute yourself requires you to be familiar with HTML tags and their attributes. You can use the Reference panel, located in the Code panel group, to learn more about tags and their attributes. For example, if you select TD in the Tag drop-down menu on the Reference panel, you can learn about that tag's attributes by clicking the Description drop-down menu and selecting one of the tag attributes, such as bgcolor.

Click the Make Attribute Editable check box. Leave the Label, Type, and Default settings as they are and click OK. Save the profile template, click Update, close the Update Pages dialog box and close the file.

The Editable Tag Attributes dialog box closes. The background color of the main cell is now an editable tag. The color of the background in the profile.dwt document will change because of the code used to make that attribute editable in the files that use the profile template. The profile.dwt template may not display as expected if you preview it in the browser after making bgcolor attribute editable. In order for Dreamweaver to create the necessary template markup that allows it to control all documents based on the template, the code displayed in the Bg text field is @@bgcolor@@. This kind of markup is necessary for the template to function and will not cause viewing irregularities in the final documents that are based on the template.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint