Spawning a Dialog
Now that you have successfully created a dialog, you need a way to open it from within the application. There are primarily two different ways to open a dialog:
- in response to a user clicking on a menu item in Movable Type’s main navigation
Opening a Dialog from a Link
openDialog which is loaded for you automatically on every page inside the Movable Type application. The
- source - this parameter is present for backwards compatibility purposes. It is permissible to pass the value
nullto this input parameter
- mode name - the name of the mode registered with Movable Type that will be invoked. This is the mode name for your dialog as registered within your
- query string - any additional parameters you want to pass to the dialog
ScriptURI, the text
?__mode=, the input parameter mode name, and the text found in the input parameter query string.
Opening a Dialog from the Navigation Menu
Dialogs can be spawned directly from a menu item in the navigation menu, as in the “Upload File” menu item in the Create menu. To spawn a dialog, one would register their menu item using the
dialog property as illustrated below:
name: Example Plugin for Movable Type
description: This plugin is an example plugin for Movable Type.
label: 'Launch a Dialog'