The Insert bar definition file

 < Day Day Up > 

The Configuration/Objects/insertbar.xml file defines the Insert bar properties. This XML file contains definitions for each individual object, in the order in which the objects appear.

The first time a user starts Dreamweaver, the Insert bar appears horizontally above the document. After that, its visibility and position are saved in the registry.

Insertbar.xml tag hierarchy

The following example shows the format and hierarchy of nested tags in the insertbar.xml file:

 <?xml version="1.0" ?> <!DOCTYPE insertbarset SYSTEM "-//Macromedia//DWExtension insertbar 5.0"> <insertbar xmlns:MMString="http://www.macromedia.com/schemes/data/string/"> <category  MMString:name="insertbar/categorycommon"   folder="Common">     <button  image="Common\Hyperlink.png"     MMString:name="insertbar/hyperlink" file="Common\Hyperlink.htm" />     <button  image="Common\E-Mail Link.png"     MMString:name="insertbar/email" file="Common\E-Mail Link.htm" />     <separator />   <menubutton  MMString:name="insertbar/images"   image="Common\Image.png">     <button  image="Common\Image.png"     MMString:name="insertbar/image" file="Common\Image.htm" /> ...    </menubutton>    <separator />      <button  MMString:name="insertbar/tagChooser"      image="Common\Tag Chooser.gif" command="dw.showTagChooser()"      codeOnly="TRUE"/>   </category>     ...   </insertbar> 

NOTE

Although the insertbar and category tags use </insertbar> and </category> closing tags to denote the end of their content, the tags button, checkbutton, and separator do not have related closing tags. Instead button, checkbutton, and separator use a slash (/) before the closing bracket to denote the end of their attributes and content.


Insert bar definition tags

The insertbar.xml file contains the following tags and attributes:

<insertbar>

Description

This tag signals the content of the Insert bar definition file. The </insertbar> closing tag specifies the end of the content.

Attributes

None.

Example

 <insertbar>    <category  folder="Common">      <button  image="Common\Hyperlink.gif"      file="Common\Hyperlink.htm"/>   ... </insertbar> 

<category>

Description

This tag defines a category on the Insert bar (such as Common, Forms, or HTML). The </category> closing tag specifies the end of the category content.

NOTE

By default, the Insert bar is organized into categories of use (such as Common, Forms, or HTML). In previous versions of Dreamweaver, the Insert bar was organized similarly by tabs. Users can set their own preferences for how the Insert bar objects are organized (by category or tab). If the user has selected the tab organization, the category tag defines each tab.


Attributes

 id, {folder}, {showIf} 

Example

 <category  folder="Common">   <button  image="Common\Hyperlink.gif"   file="Common\Hyperlink.htm"/>   </category> 

<menubutton>

Description

This tag defines a pop-up menu for the Insert bar.

Attributes

 id, image, {showIf}, {name}, {folder} 

Example

 <menubutton        name="Images"    image="Common\imagemenu.gif"    folder="Images">    <button        image="Common\Image.gif"       enabled=""       showIf=""       file="Common\Image.htm" /> </menubutton> 

<button />

Description

This tag defines a button on the Insert bar that the user clicks to execute the code that the command or file attributes specify.

Attributes

 id, image, name, {canDrag}, {showIf}, {enabled}, {command}, {file}, {tag}, {codeOnly} 

Example

 <button  image="Common\Object.gif" name="Object" enabled="true" showIf="" file="Common\Obect.htm"   /> 

<checkbutton />

Description

A checkbutton is a button that has a checked or unchecked state. When clicked, a checkbutton appears pressed in and highlighted. When it is unchecked, a checkbutton appears flat. Dreamweaver has Mouse-over, Pressed, Mouse-over-while-pressed, and Disabled-while-pressed states. The command must ensure that clicking the checkbutton causes its state to change.

Attributes

 id, image, checked, {showIf}, {enabled}, {command}, {file}, {tag}, {name}, {codeOnly} 

Example

 <checkbutton  name = "Standard View" image="Tools\Standard View.gif" checked="_View_Standard" command="dw.getDocumentDOM().setShowLayoutView(false)"/> 

<separator />

Description

This tag displays a vertical line on the Insert bar.

Attributes

 {showIf} 

Example

 <separator showIf="_VIEW_CODE"/> 

Insert bar definition tag attributes

The attributes for the Insert bar definition tags have the following meanings:

Description

The id attribute is an identifier for the buttons that appear on the Insert bar. The id attribute must be unique for the element within the file.

Example

 

image="image_path"

Description

This attribute specifies the path, relative to the Dreamweaver Configuration folder, to the icon file that appears on the Insert bar. The icon can be in any format that Dreamweaver can render, but typically it is in GIF or JPEG file format, with a size of 18 x 18 pixels.

Example

 image="Common/table.gif" 

canDrag="Boolean"

Description

This attribute specifies whether the user can drag the icon into the code or workspace to insert the object into a document. If omitted, the default value is true.

Example

 canDrag="false" 

showIf="enabler"

Description

This attribute specifies that this button should appear on the Insert bar only if the given Dreamweaver enabler is a TRue value. If you do not specify showIf, the button always appears. The possible enablers are _SERVERMODEL_ASP, _SERVERMODEL_ASPNET, _SERVERMODEL_JSP, _SERVERMODEL_CFML (for all versions of Macromedia ColdFusion), _SERVERMODEL_CFML_UD4 (only for UltraDev version 4 of ColdFusion), _SERVERMODEL_PHP, _FILE_TEMPLATE, _VIEW_CODE, _VIEW_DESIGN, _VIEW_LAYOUT, _VIEW_EXPANDED_TABLES, and _VIEW_STANDARD.

To specify multiple enablers, place a comma (which means AND) between the enablers. To specify NOT, use an exclamation point (!).

Example

If you want a button to appear only in Code view for an ASP page, specify the enablers as follows:

 showIf="_VIEW_CODE, _SERVERMODEL_ASP" 

enabled="enabler"

Description

This attribute specifies that the item is available to the user if the DW_enabler value is true. If you do not specify the enabled function, the item defaults to always enabled. The possible enablers are _SERVERMODEL_ASP, _SERVERMODEL_ASPNET, _SERVERMODEL_JSP, _SERVERMODEL_CFML (for all versions of ColdFusion), _SERVERMODEL_CFML_UD4 (only for UltraDev version 4 of ColdFusion), _SERVERMODEL_PHP, _FILE_TEMPLATE, _VIEW_CODE, _VIEW_DESIGN, _VIEW_LAYOUT, _VIEW_EXPANDED_TABLES, and _VIEW_STANDARD.

To specify multiple enablers, place a comma (which means AND) between the enablers. To specify NOT, use an exclamation point (!).

Example

If you want the button to be available only in Code view, specify the following:

 enabled="_VIEW_CODE" 

This dims the button in other views.

checked="enabler"

Description

The checked attribute is required if you use the checkbutton tag.

The item is checked if the DW_enabler value is true. The possible enablers are _SERVERMODEL_ASP, _SERVERMODEL_ASPNET, _SERVERMODEL_JSP, _SERVERMODEL_CFML (for all versions of ColdFusion), _SERVERMODEL_CFML_UD4 (only for UltraDev version 4 of ColdFusion), _SERVERMODEL_PHP, _FILE_TEMPLATE, _VIEW_CODE, _VIEW_DESIGN, _VIEW_LAYOUT, _VIEW_EXPANDED_TABLES, and _VIEW_STANDARD.

To specify multiple enablers, place a comma (which means AND) between them. To specify NOT, use an exclamation point (!).

Example

 checked="_View_Layout" 

command="API_function"

Description

Instead of referring Dreamweaver to an HTML file that contains the code to insert, you use this tag to specify a command that Dreamweaver performs when the button is clicked.

Example

 command="dw.showTagChooser()" 

file="file_path"

Description

The file attribute specifies the path, relative to the Dreamweaver Configuration folder, of an object file. Dreamweaver derives the tooltip for the object icon from the title of the object file, unless you specify the name attribute.

Example

 file="Templates/Editable.htm" 

tag="editor"

Description

This attribute tells Dreamweaver to invoke a Tag editor. In Code view, if the tag attribute is defined and the user clicks the object, Dreamweaver invokes the Tag dialog box. In Code view, if you specify the tag and command attributes, Dreamweaver invokes the Tag editor. In Design view, if codeOnly="TRUE" and you do not specify the file attribute, Dreamweaver MX invokes Split view, places focus in the code, and invokes the Tag editor.

Example

 tag = "form" 

name="tooltip_text"

Description

The name attribute specifies the tooltip that appears when the mouse pointer rests over the object. If you specify an object file but do not specify the name attribute, Dreamweaver uses the name of the object file for the tooltip.

NOTE

If the name attribute is not provided, the object will not be available for grouping in the Favorites category on the Insert bar UI.


Some Insert bar objects use a variation of the name attribute with prefix MMString. The MMString denotes a localized string; these values are explained in "Localizing an extension" on page 107.

Example

 name = "cfoutput" 

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

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