
144
EXTENDING DREAMWEAVER CS4
Menus and menu commands
• arguments Provides arguments for Dreamweaver to pass to the code in the JavaScript file that you specify in the
file attribute. Enclose arguments in single quotation marks ('), inside the double quotation marks (") used to
delimit an attribute’s value.
• command Specifies a JavaScript expression that’s executed when the user selects this item from the menu. For
complex JavaScript code, use a JavaScript file (specified in the
file attribute) instead. You must specify either file
or
command for each menu command.
• file The name of an HTML file containing JavaScript that controls the menu command. Specify a path to the
file relative to the Configuration folder. (For example, the Help > Welcome menu command specifies
file="Commands/Welcome.htm".) The file attribute overrides the command, enabled, and checked attributes.
You must specify either
file or command for each menu command. For information on creating a command file
using the History panel, see Dreamweaver Help. For information on writing your own JavaScript commands, see
“Commands” on page 131.
• checked A JavaScript expression that indicates whether the menu command has a check mark next to it in the
menu; if the expression evaluates as true, the item appears with a check mark.
• dynamic If present, indicates that a menu command is to be determined dynamically by an HTML file; the file
contains JavaScript code to set the text and state of the menu command. If you specify a tag as
dynamic, you must
also specify a
file attribute.
• isdomrequired Indicates whether to synchronize the Design view and the Code view before executing the code
for this menu command. Valid values are "
true" (the default) and "false". If you set this attribute to "false", it
means that the changes to the file that this menu command makes do not use the Dreamweaver DOM. For
information about the DOM, see
“The Dreamweaver Document Object Model” on page 95).
• showIf Specifies that the menuitem should appear only if the given Dreamweaver enabler has value true. The
possible enablers are:
_SERVERMODEL_ASP, _SERVERMODEL_ASPNET, _SERVERMODEL_JSP,
_SERVERMODEL_CFML (for all versions of Adobe ColdFusion), _SERVERMODEL_CFML_UD4 (for UltraDev version 4 of
ColdFusion),
_SERVERMODEL_PHP, _FILE_TEMPLATE, _VIEW_CODE, _VIEW_DESIGN, _VIEW_LAYOUT,
_VIEW_EXPANDED_TABLES, and _VIEW_STANDARD. You can specify multiple enablers by placing a comma (which
means AND) between the enablers. You can specify NOT with
"!". For example, if you want the menu command
to appear in Code view but not for a ColdFusion page, specify the attribute as
showIf="_VIEW_CODE,
!_SERVERMODEL_CFML".
Contents
None (empty tag).
Container
This tag must be contained in a menu tag.
Example
<menuitem name="_New" key="Cmd+N" enabled="true" command="dw.createDocument()"
id="DWMenu_File_New" />
<separator>
Description
Indicates that a separator should appear at the corresponding location in the menu.
Comentarios a estos manuales