Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Edit Media Entity in Modal

2,409 sites No security coverage
View on drupal.org

This module allows users to edit media entities directly within a modal window, streamlining the content editing process, especially when working with embedded media in rich text editors. This provides a more efficient and user-friendly experience for managing media content.

The Edit Media Entity in Modal module for Drupal enhances the content editing experience by enabling users to edit media entities directly within a modal dialog. This functionality streamlines workflows, particularly for content creators and editors working with embedded media in rich text editors like CKEditor.
This module is ideal for Drupal sites aiming to provide a more efficient and user-friendly media editing experience.

🛠 Installation

To install the module, run the following commands:

composer require drupal/edit_media_modal
drush en edit_media_modal

Version 2.x

For CKEditor 5 support, ensure you're using version 2.0.0 or higher.

📹 Demonstration

For a visual demonstration of the module in action, refer to the following video:
https://youtu.be/hgTfaZcjzXw

Usage

As default module provides an edit media link for the EditorMediaDialog. But You will be able to use this improvement in the many places where do you need that.

  $form['edit_media_link'] = $media->toLink($this->t('Edit this media'), 'edit-form', [
    'query' => [
      'edit_media_in_modal' => TRUE, // Add that to have ajax actions for the media edit form.
      'destination' => \Drupal\Core\Url::fromRoute('<front>')->toString(), // Add that if you need redirect somewhere after submitting.
    ],
  ])->toRenderable();

  $form['edit_media_link']['#attributes'] = [
    'class' => [
      'js-media-library-edit-modal-link',
      'media-library-edit__modal-link',
      'use-ajax',
      'button',
    ],
    'target' => '_self',
    'data-dialog-options' => json_encode([
      'height' => '75%',
      'width' => '75%',
      'classes' => [
        'ui-dialog-content' => 'media-library-edit__modal-link',
      ],
    ]),
    'data-dialog-type' => 'modal',
  ];

Activity

Total releases
2
First release
Aug 2025
Latest release
8 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
2.1.0 Stable Oct 22, 2025
2.0.2 Stable Aug 1, 2025