Drupal is a registered trademark of Dries Buytaert
Module Revived: Entity API 8.x-1.7 Module entity updated after 17 months of inactivity (8.x-1.7). Release: WebProfiler 11.2.2 Minor update available for module webprofiler (11.2.2). Release: Field Nif, Nie or Cif 1.2.0 Minor update available for module field_nif_nie_cif (1.2.0). Release: Image Styles Builder 1.1.8 Minor update available for module image_styles_builder (1.1.8). Release: Static Suite 1.2.13 Minor update available for module static_suite (1.2.13). Release: Simple password policy 1.1.2 Minor update available for module simple_password_policy (1.1.2). Release: Simple password policy 1.1.1 Minor update available for module simple_password_policy (1.1.1). Release: Static Suite 1.2.12 Minor update available for module static_suite (1.2.12). Release: Audit Chain 1.4.0 Minor update available for module audit_chain (1.4.0). Usage Milestone: Field as Block Module fieldblock crossed 1,000 active installs.

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
1 month 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