Each
tag in the XML file places an icon on the Insert bar and connects it to the
button
proper HTML file or function.
To add the new object to the Insert bar:
1.
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.
2.
Start a new line after the category tag; then insert the
, and
image
file
The ID must be a unique name for the button (following standard naming conventions,
use
DW_Text_Strikethrough
Dreamweaver the location of the supporting files, as shown here:
<button id="DW_Text_Strikethrough"
image="Text\Strikethrough.gif"
file="Text\Strikethrough.htm"/>
3.
Save the insertbar.xml file.
4.
Reload the extensions (see
The new object appears at the beginning of the Common category on the Insert bar, as shown
in the following figure:
Adding a dialog box
You can add a form to your object to let the user enter parameters before Dreamweaver inserts
the specified code (for example, the Hyperlink object requests the text, link, target, category
index, title, and access key values from the user). In this example, you add a form to the
Strikethrough object from the previous example. The form opens a dialog box that provides
the user with the option to change the text color to red as well as add the strike-through tag.
This example assumes you have already created a separate JavaScript file called
Strikethrough.js.
First, in Strikethrough.js, you add the function that the form calls if the user changes the text
color. This function is similar to the
is an optional function.
154
Insert Bar Objects
attributes for the Strikethrough object.
for this object). The
"Reloading extensions" on page
objectTag()
tag and assign it the
button
and
image
file
104).
function for the Strikethrough object, but
,
id
attributes simply tell
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers