Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module automatically adds necessary AJAX and dialog libraries to links with the "use-ajax" class within text formats. This allows editors to create modal or off-canvas AJAX dialogs directly from formatted text without custom coding. It is recommended to enable this filter only for trusted user roles and higher-level text formats like "Full HTML."

Automatically loads required AJAX dialog libraries when text formats contain links using the use-ajax class.

This is currently work in progress (WIP) - please help to get this tested and finished!

See https://www.drupal.org/docs/develop/drupal-apis/ajax-api/ajax-dialog-box... for examples.

Important: Only enable this for higher level text formats like "Full HTML" for user roles you can trust!
Enabling this text filter for untrusted roles can cause security risks.

Features

The Ajax Dialog Filter module ensures that any <a> tag inside a text‑formatted field that includes the use-ajax class automatically receives the required Drupal AJAX dialog libraries. This allows editors to create modal or off‑canvas AJAX dialogs directly from formatted text without writing custom code or attaching libraries manually.

What it does:

  • Detects class="use-ajax" class inside <a href="https://www.drupal.org/node/123" class="use-ajax" data-dialog-type="modal">Open AJAX Modal</a> via text formats
  • Automatically attaches core/drupal.ajax, core/drupal.dialog.ajax, and related libraries
  • Ensures AJAX dialogs work reliably even when triggered from CKEditor or other formatted text sources

Why use it:

  • Ideal for sites that use modal dialogs for help text, embedded forms, or interactive UI elements
  • Removes the need for custom preprocess hooks or theme overrides
  • Ensures consistent behavior across all text formats and content types

Use cases:

  • Opening modal forms from body text
  • Triggering AJAX dialogs from CKEditor content
  • Creating interactive help links or inline modal content
  • Enabling editors to add AJAX dialogs without developer intervention

Post-Installation

After installing the module:

  1. Go to Configuration → Content authoring → Text formats and editors
  2. Edit the text format you want to support (e.g., Basic HTML)
  3. Enable AJAX dialog library loader in the filter list
  4. Place it near the bottom of the filter order

No additional configuration pages or content types are added. Once enabled, the filter automatically scans rendered text and attaches the required libraries whenever it finds a link with the use-ajax class.

Additional Requirements

This module has no additional requirements beyond Drupal core. It relies on the AJAX and dialog libraries already included in Drupal.

Activity

Tracked releases
2
Tracked since
Jun 2026
Latest release
2 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Jun 23, 2026
1.x-dev Dev Jun 23, 2026