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.

Media Directories

5,668 sites Security covered
View on drupal.org

This module adds a folder structure to your media items, making them easier to organize. It also provides a modern browser for managing and embedding media, with integration for CKEditor 5 to insert media directly into your content.

Media Directories adds a directory (folder) structure to Media entities and ships a modern Vue.js media browser for managing and embedding them. Folders are backed by a taxonomy vocabulary: enabling the module adds a directory field to every Media entity, so each item can be assigned to a folder and browsed in a familiar tree.

The companion Media Directories Browser submodule provides a fast, single-page Vue.js browser that integrates with CKEditor 5 for embedding media directly into content, and with media reference fields for selecting and uploading.

New 3.x version

This version is working and can be used on new installations. Previous sites using 2.x and CKEditor integration must wait until compatibility module is ready or do manual content migration.

Read more from documentation page

Compatibility module

Initial version of compatibility module is available, but it is not tested. This is only for CKEditor content.

The compatibility module only provides a layer for entity embed objects. This should be enough for most of the sites.

Content migration is not planned at the moment. This takes too much effort and could be complicated to get it right.

Features

  • Folder/directory structure for Media, backed by a taxonomy vocabulary
  • A directory field on every Media entity for assigning items to folders
  • Vue.js media browser with drag-and-drop organization, search and quick edit
  • CKEditor 5 integration for embedding media into rich text
  • Integration with core Media and Media Library
  • Optional AI-powered alt text generation and translation
  • Optional CKEditor 5 file download links

Modules

The project is a suite — enable only the pieces you need:

  • Media Directories — the base module: the directory field and Media Library integration.
  • Media Directories Browser — the Vue.js media browser with CKEditor 5 embedding (the recommended editor experience).
  • Media Directories File Link — a CKEditor 5 plugin for inserting file download links via the browser.
  • Media Directories AI — AI-powered alt text generation and translations inside the browser (requires the AI module).
  • Media Directories Compatibility — converts legacy <drupal-entity> embeds to <drupal-media> at render time; enable it on sites migrating from entity_embed-based embedding.
  • Media Directories Image Resize — resizes images in text content that carry explicit width/height attributes.

Note for existing users: the older media_directories_ui (jsTree) and media_directories_editor (entity_embed) submodules are deprecated and replaced by media_directories_browser. New sites should use the Browser submodule.

Requirements

  • Drupal 11 or 12 (the base module also supports 10.2, but Media Directories Browser and the submodules built on it require 11+)
  • Media (core)
  • Media Library (core)
  • Taxonomy (core)
  • Views (core)
  • CKEditor 5 (core) — for Media Directories Browser and Media Directories File Link

No external JavaScript libraries are required — the browser is a bundled Vue.js application.

Installation

Install with Composer, then enable the submodules you need:

composer require drupal/media_directories
  1. Enable Media Directories (and Media Directories Browser for the editor experience).
  2. Create a vocabulary to hold the directory structure.
  3. Select that vocabulary in the settings: /admin/config/media/media_directories

Configuration

  • Browser / CKEditor 5: add the Media Directories button to the CKEditor 5 toolbar of any text format that should support media embedding (e.g. full_html at /admin/config/content/formats/manage/full_html), and make sure the Embed media and Display embedded entities filters are enabled on that format — without them, embedded media will not render.
  • File Link: add the Insert file link button to the CKEditor 5 toolbar of the relevant text formats.
  • AI: configure an AI provider via the AI module (add a key, choose a default provider). Alt text and translation actions then appear inside the browser.

Also review permissions: users need the appropriate Media and Taxonomy term permissions to create, move/edit and delete media and folders.

Recommended modules

  • SVG image — adds SVG support to the image fields used by media types.
  • Focal Point — enables focal point selection inside the media browser.
  • AI — required by the Media Directories AI submodule for AI-generated alt text and translations.

Migration of an existing vocabulary

Migrating an already-existing vocabulary is not supported out of the box, as the module uses a dedicated term reference rather than a regular field. You can follow the manual approach described in #3405584: Existing term settings ignored to migrate an existing term reference on your media.

Documentation

Full documentation is published with MkDocs and hosted on GitLab Pages: https://project.pages.drupalcode.org/media_directories/

Roadmap

#3102317: [META] Roadmap

Activity

Total releases
11
First release
Feb 2025
Latest release
1 week ago
Releases (12 mo)
4 ▼ from 7
Maintenance
Active

Release Timeline

Releases

Version Type Release date
3.0.0-beta1 Pre-release Jul 8, 2026
3.0.0-alpha1 Pre-release Jun 12, 2026
3.0.x-dev Dev Apr 14, 2026
2.2.0-beta2 Pre-release Apr 14, 2026
2.1.0-beta6 Pre-release Feb 24, 2025
2.2.0-beta1 Pre-release Feb 24, 2025
2.2.0-alpha3 Pre-release Feb 9, 2025
2.1.0-beta5 Pre-release Feb 6, 2025
2.2.0-alpha2 Pre-release Feb 6, 2025
2.2.0-alpha1 Pre-release Feb 6, 2025
2.2.x-dev Dev Feb 5, 2025