Picture
Minnur Yunusov Senior Drupal Developer Follow
May 11, 2023

 

Many Drupal developers don't notice how many confirmation pages or small forms exist that take users to a separate page; I wanted to streamline that experience by reducing the number of page loads and redirects. And since dialogs come with Drupal core I decided to leverage that and create a custom module that would do a couple of things:

  • handle most of the Drupal core page dialogs
  • make it easy to configure for developers in their installations.

I've been using modal and off-canvas dialogs in most of my custom modules and found it to be a really nice addition. This informed what has turned into the Admin Dialogs module, which I just launched this week.

The Admin Dialogs module improves the UI by reducing the number of page loads. For example, instead of opening a delete confirmation page, the module will show the form in a dialog (modal) form. I can see this module being a great companion to the Admin Toolbar module.

Note: if Javascript isn't supported everything falls into default behavior.

Before Admin Dialog module (Gin theme):

Before Admin Dialog module.

After Admin Dialog module (Gin theme) - Confirmation form is shown in a dialog form: 

After Admin Dialog module

Key Features

The module comes with the ability to add modal or off-canvas dialogs to different links in Drupal. A quick rundown follows:

  • Easy to use. Most features available after installing the module
  • Adds controls dialog type for operation links like Edit, Delete, etc.
  • Adds and controls dialog type for local tasks
  • Adds and controls dialog types for local actions
  • Ability to add dialogs via specified A tag paths
  • Ability to add dialogs via specifying CSS selectors (classes and IDs)
  • Adds option to control delete button dialog
  • You can add support for you modules by adding configs created in the module.

How to use 

Get the code like any other module:


composer require drupal/admin_dialogs

If you want to chat about use cases for the module or have any questions, feel free to visit the project page and connect with me there.