Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Edit Media Entity in Modal

2,379 sites No security coverage Drupal 10โ€“11
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',
  ];

Depends on

Dependencies of the latest stable release

  • media Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jan 2025
Latest release
10 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
2.1.0 Stable 10โ€“11 Oct 22, 2025
2.0.2 Stable 10โ€“11 Aug 1, 2025
2.0.1 Stable 10โ€“11 Jan 5, 2025