Drupal is a registered trademark of Dries Buytaert

media_entity_twig

1 sites Security covered
View on drupal.org

The Media Entity Twig module provides a powerful way to add Twig templates, content and components as media items that can be re-used anywhere you can add media.

This can be useful if you've built interactive components that you want to feature instead of more traditional media such as images and video.

This module is designed for Drupal 10.3+ and is ideal for theme developers, frontend engineers, site builders and anyone needing to add twig things to be used and reused as media items.

Usage:

  1. Require the module into your project via Composer: composer require drupal/media_entity_twig.
  2. Enable the module in the UI: /admin/modules#module-media-entity-twig or via drush: drush en media_entity_twig
  3. Go to media types /admin/structure/media and you will see a new media type called Twig.
  4. A default twig field is automatically added with default field settings. You can now customise or add additional fields at /admin/structure/media/manage/twig/fields
  5. You can now add media of type twig in addition to the default media types such as image and video.

Additional Requirements

This module requires Drupal's core image, media, media_library, and path modules as well as the contrib module twig_field.

Community Documentation

I will provide a YouTube walkthrough of the functionality this module provides soon!

Supporting organisation

Pivale are a globally trusted web development company who build Drupal CMS websites and software.

Activity

Total releases
6
First release
May 2025
Latest release
8 months ago
Release cadence
2 days
Stability
17% stable

Release Timeline

Releases

Version Type Release date
1.0.0 Stable Jun 9, 2025
1.0.0-beta2 Pre-release May 30, 2025
1.0.0-beta1 Pre-release May 30, 2025
1.0.0-alpha2 Pre-release May 28, 2025
1.0.x-dev Dev May 28, 2025
1.0.0-alpha1 Pre-release May 28, 2025