User Guide
128 Chapter 6: Insert Bar Objects
</script>
</head>
<body>
</body>
</html>
Save this file to the Configuration/Objects/Text folder as Strikethrough.htm, and create a graphic
(GIF format, 18 x 18 pixels) for use on the Insert bar, as shown in the following figure:
Name the graphic file Strikethrough.gif, and save it in the Configuration/Objects/Text folder.
Now your HTML file identifies the code to insert into the document, and you have the
accompanying graphic file for the Insert bar. You need to edit the insertbar.xml file so
Dreamweaver can associate these two items with the Insert bar interface.
Note: Before you edit the insertbar.xml file, you might want to copy the original one as
insertbar.xml.bak, so you have a backup.
The code within the insertbar.xml file identifies all the existing objects on the Insert bar. Each
category tag in the XML file creates a category in the interface. Each menubutton tag creates a
pop-up menu on the Insert bar. And, each
button tag in the XML file places an icon on the
Insert bar and connects it to the proper HTML file or function.
To add the new object to the Insert bar, find the following line near the beginning of the
inserbar.xml file:
<category id="DW_Insertbar_Common" MMString:name="insertbar/category/common"
folder="Common">
This line identifies the beginning of the Common category on the Insert bar. Start a new line after
the category tag, and insert the
button tag and assign it the id, image, and file attributes for the
Strikethrough object. The
id must be a unique name for the button (following standard naming
conventions; use
DW_Text_Strikethrough for this object). The image and file attributes
simply tell Dreamweaver the location of the supporting files, as shown in the following example:
<button id="DW_Text_Strikethrough"
image="Text\Strikethrough.gif"
file="Text\Strikethrough.htm"/>
Save the insertbar.xml file, reload the extensions (see “To reload extensions” on page 120), and the
new object appears at the beginning of the Common category on the Insert bar, as shown in the
following figure:
Creating a separate JavaScript file
In “A simple Insert Object example” on page 126, you create a single object HTML file
containing both the HTML for the object and the JavaScript supporting the implementation of
the object. However, you can separate the JavaScript functions from the HTML object definition
file. This separate organization is very useful for objects containing several functions, or functions
that might be shared by other objects.