Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

This addition has been reverted in #1870764: Add an ajax command which makes it easy to use the dialog API in complex cases. Now please see Ajax commands for opening and closing Dialogs and generic Dialog Controller added to core.


See Dialog API for JavaScript for information about using the new Dialog API from JavaScript.

The Dialog feature has also been integrated with Drupal's Ajax API. The #ajax element property now supports a dialog key. The value is an array of settings, and can be an empty array. Currently, the only supported dialog setting is modal, but more settings may be added later.

For example, to display a link that opens the user registration page in a modal dialog, code can do this:

// This does not work. It is retained here for reference.
$link = array(
  '#type' => 'link',
  '#title' => t('Register'),
  '#href' => 'user/register',
  '#ajax' => array(
    'dialog' => array('modal' => TRUE),
  ),
);

Impacts: 
Module developers