I've been quiet on this site lately. However, if you've been keeping up with me, you know that for over a year, I've been involved with efforts to improve media handling in Drupal 7, and I've been evangelizing those improvements. By media, I mean images, video, audio, PDF files, and other files that some might also call "assets." In this article, I provide an overview of two modules that are changing the paradigm of Drupal media handling, File Entity and Media, and I explain why this new paradigm of media handling is important to the future of Drupal.
The File Entity module allows you to manage files as first-class Drupal entities. Other examples of entities are nodes, taxonomy terms, and users. Like all of these, the File Entity module allows you to define fields for each type of file (default types: image, video, audio, and document). With fields, you can organize and classify your files using your own classification system.
Any file that can be accessed with a stream wrapper can be managed using File Entity. This means, with the help of additional contributed modules, content on cloud storage services, CDNs, and from providers such as YouTube or Flicker, can also be managed via File Entity without ever requiring the source files to be moved to the local file system.
The functionality of File Entity is so fundamental that much of it will be in Drupal 8 core.
The Media module makes it possible to use files managed by File Entity in your content. It provides the Media Browser View, which you can customize like any other Views view. This allows you to sort and filter on the custom fields you define in File Entity. It also provides the Media Browser Widget for file fields, allowing you to use File Entity-managed files with your file fields in other content. Finally, it provides a WYSIWYG plug-in to embed your File Entity-managed files in your long text fields.
Why the File Entity+Media approach is important
Together, File Entity and Media allow you to create a media library, where you can categorize, find, and re-use media assets in your content.
For some, using File Entity and Media to manage media assets seems like overkill. And on sites for which media is sparsely used (maybe just an occasional illustration or video link), it may indeed be too much overhead to manage your media with File Entity and Media. However, If you think you may collect and reuse a large number of image, video, audio, PDF, or other assets, File Entity and Media will make your job much easier. With the ability to categorize and classify media assets, File Entity and Media allow large organizations to more easily share and reuse media assets on their sites.
Reasons to use File Entity + Media:
- One common framework and interface for working with all types of media.
- WYSIWYG integration.
- Fields on File Entities, allowing you to (for example) categorize your media assets with taxonomy terms and describe them in text fields.
- Views-based Media browser, allowing you to list and search for media based on filters.
In future posts, I will illustrate specific examples of using File Entity and Media in your Drupal site.
Going to Florida Drupalcamp on April 20? Vote for my session on Media Management in Drupal.