Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Modal

Security covered Under active development 2,971 sites

Modal allows you to create and display dialogs, notifications, or custom content on your Drupal site. You can configure placement, content, display conditions, and even trigger them dynamically or through specific actions.

Use Modal to add dialogs to your site for lightboxes, user notifications, or completely custom content.

Just go at: Administration ยป Structure ยป Modal

Have fun :)

Modal 6 is ready ๐Ÿป

Highlights:

  • โœ… Drupal 11
  • โœ… Drupal Dialog API
  • โœ… Bootstrap 5

Enjoy! ๐Ÿ˜€











With Modal you're able to

  • Flexible Placement: Position modals anywhere through the CMS;
  • Content Creation: Utilize CKEditor for modal content;
  • Display Configuration: Specify pages to show your modal;
  • Configuration Management: Export and import modals easily;
  • Wildcard Usage: Use wildcards in the URL path for flexibility;
  • Page Load Display: Set the modal to appear on page load;
  • Custom Triggering: Open modal by clicking a custom class or ID;
  • Dynamic Modification: Customize modals dynamically with hooks;
  • Custom Actions: Create actions with hook_modal_submit();
  • Visual: Personalize modal's header, footer, and buttons;
  • Sizes: Support for different modal sizes;
  • Access Control: Select roles that can view the modal;
  • API: Create modals programmatically via the Entity Manager.

Liked? Give us a star โญ๏ธ at top-right of this page to encourage me

Matrix

Modal D9 D10 D11 Bootstrap Dialog API Toast Status 6.0.x โŒ โœ… โœ… โœ… โœ… โœ… New Features 5.1.x โŒ โœ… โœ… โœ… โŒ โŒ Stable 5.0.x โœ… โœ… โŒ โœ… โŒ โŒ Bugfixes only


Hooks

hook_modal_alter

You're able to update your Modal before display with this code

/**
 * Implements hook_modal_alter().
 */
function HOOK_modal_alter(&$modal, $modal_id) {
  $modal->setLabel('Title Updated');
  $modal->setBody('Body Updated');
}

hook_modal_ID_alter

You're able to update Modal by ID (machine_name) with this example

/**
 * Implements hook_modal_ID_alter().
 */
function HOOK_modal_ID_alter(&$modal, $modal_id) {
  $modal->setLabel('New Title');
  $modal->setBody('New Body');
}

hook_modal_submit

You're able to use Hook Modal Submit and work with Ajax with this example

/**
 * Implements hook_modal_submit().
 */
function HOOK_modal_submit($modal, $modal_state, $modal_id) {

  // Your AJAX logic here.
  \Drupal::logger('modal_page')->notice('Modal Submit was triggered');

}

Insert Modal programmatically

$modal = \Drupal::entityTypeManager()->getStorage('modal')->create();

$modal->setId('modal_id');
$modal->setLabel('Modal Title');
$modal->setBody('Modal Content');
$modal->setPages('/hello');
$modal->save();

Suggestions and Helpers

Modal are completely free. Everyone is welcome to help.

Feel free to submit your suggestion at issue queue or buy us a coffee

Help us Buy us a coffee โ˜•๏ธ

Meet the Modal Maintainers

Renato G. H. (RenatoG)

Author|Maintainer

Paulo H. Starling (paulocs)

Maintainer

Thalles Ferreira (thalles)

Maintainer


Graphic designer

Nico Grienauer

(grienauer)

Logo author














Modal Documentation

See our documentation here

Credits


http://www.ciandt.com

Drupal 10โ€“11

Ask your assistant about Modal

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • JS Cookie
  • datetime Drupal core
  • filter Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
43
Tracked since
Jul 2023
Latest release
5 months ago
Releases (12 mo)
26 ▲ from 7
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
6.0.0-beta5 Pre-release 10โ€“11 Nov 1, 2025
5.1.3 Stable 10โ€“11 Nov 1, 2025
5.0.13 Stable 9โ€“11 Nov 1, 2025
6.0.0-beta4 Pre-release 10โ€“11 Oct 19, 2025
5.1.2 Stable 10โ€“11 Oct 19, 2025
5.0.12 Stable 9โ€“11 Oct 19, 2025
6.0.0-beta3 Pre-release 10โ€“11 Aug 12, 2025
5.1.1 Stable 10โ€“11 Aug 12, 2025
5.1.x-dev Dev 10โ€“11 Oct 29, 2024
6.0.0-beta2 Pre-release 10โ€“11 Oct 29, 2024