beautypg.com

Chapter 7: insert bar objects, How object files work, Insert bar objects – Adobe Extending Dreamweaver CS4 User Manual

Page 110

background image

104

Chapter 7: Insert bar objects

You can add items to the Insert bar to automate repetitive tasks for your users or even create dialog boxes for users to
set specific attributes.

Objects reside in the Configuration/Objects folder inside the Dreamweaver application folder. The Objects subfolders
are grouped according to their location on the Insert bar, and you can open these files to see the construction of current
objects. For example, you can open the Configuration/Objects/Common/Hyperlink.htm file to see the code that
corresponds to the hypertext link object button on the Insert bar.

The following table lists the files you use to create an object:

How object files work

Objects insert specific strings of code into a user document. Objects let users add content, such as images, absolutely
positioned (AP) elements, and tables, by clicking icons or options on the menu.

Objects have the following components:

The HTML file that defines what is inserted into a document

The head section of an Object file contains JavaScript functions (or references external JavaScript files) that process
form input from the body section and control what content is added to the user document. The body of an Object
file can contain an HTML form that accepts parameters for the object (for example, the number of rows and
columns to insert in a table) and activates a dialog box for users to input attributes.

Note: The simplest objects contain only the HTML to insert, without

body

and

head

tags. For more information, see

“Customizing Dreamweaver” on the Adobe Support Center.

The 18 x 18 pixel image that appears on the Insert bar

Additions to the insertbar.xml file. The insertbar.xml file defines where the object appears on the Insert bar.

A user can select an object by clicking an icon on the Insert bar or by selecting an item on the Insert menu. When
a user selects an object, the following events occur:

1

Adobe Dreamweaver calls the

canInsertObject()

function to determine whether to show a dialog box.

The Object file is scanned for a

form

tag. If a form exists and you select the Show Dialog When Inserting Objects

option in the General Preferences dialog box, Dreamweaver calls the

windowDimensions()

function, if it is

defined. Dreamwaver calls the function to determine the size of the dialog box in which to display the form. If
no form exists in the Object file, Dreamweaver does not display a dialog box, and skips step 2.

Path

File

Description

Configuration/Objects/objecttype/

objectname.htm

Specifies what to insert in the document.

Configuration/Objects/objecttype/

objectname.js

Contains the functions to execute.

Configuration/Objects/objecttype/

objectname.gif

Contains the image that appears on the Insert
bar.

Configuration/Objects

insertbar.xml

Specifies the objects that appear, and their
order, on the Insert bar.

This manual is related to the following products: