14. drop-site
Prev | Chapter 5. Content objects | Next

## 14. drop-site

drop-site(`key`, `value`, ..., `key`, `value`)

Inserts a button in generated content which executes a command (see Chapter 6, Commands written in the Java™ programming language in XMLmind XML Editor - Commands) when a string is dropped on it.

Identical to command-button except that:

- A `drop-site` cannot be used to popup a menu.

- The user cannot click on a `drop-site`. He/she needs to drop a string on it to trigger the command.

- The parameter of the command must contain variable `%{value}` which is substituted with the dropped string.

  If the object dropped from an external application is not a string, this object will be automatically converted to a string. For example, a file is converted to a string by using its absolute filename.

  In addition to `%{value}`, the following convenience variables are also supported:

  %{url}

    If `%{value}` contains an URL or the absolute filename of a file or a directory, this variable contains the corresponding URL.

  %{file}

    If `%{value}` contains a "`file:`" URL or the absolute filename of a file or a directory, this variable contains the corresponding filename.

XHTML example:

    a[href][class="drop-site"]:after {
        content: " " drop-site(icon, icon(drop),
                               command, "setObject",
                               parameter, "href anyURI - '%{value}'");
        vertical-align: text-top;
    }

Prev | Up | Next
13. drag-source | Home | 15. file-name-field