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.
So, you may notice the appearance of my site has changed. Well, I'm in the midst of updating the theme to use HTML5 and CSS3, and I'm also beginning an effort to restructure the site overall. I hope to announce several cool changes in the near future, and I also hope to share the tools and tricks I am using to accomplish these changes.
For now, here's a couple highlights:
- I'm using the HTML5 Base theme as a base theme, accompanied by the HTML5 Tools module to adjust some of the default core output to be better aligned with HTML5.
- You may also notice some unusual fonts. CSS3 has a new @font-face rule that allows you to put fonts on your server and allows browsers to download and render them. And to make this easier in Drupal, I'm using the @font-your-face module to find and install fonts on my server.
More to come!
Well, I have successfully upgraded this site to Drupal 7, following the instructions in the UPGRADE.txt file provided in the Drupal tar file. However, I have not upgraded the theme. I'm going to retheme this guy later. For now, I've enabled the new Bartik theme that comes in Drupal 7 core. If you've been to drupal.org lately, you'll recognize it.
The only contributed module I retained is Mollom. Upgrading Mollom did not retain my settings: I had to set up Mollom almost from scratch again. But that wasn't hard.
In any case, I look forward to sharing my Drupal 7 discoveries with you in the coming weeks.
I'm at DrupalCon San Francisco right now. Conference activities actually started two days ago, Saturday, 4/17, with a Core Developer Summit (which I missed). Yesterday, 4/18, was an unconference, which I enjoyed tremendously, especially the final session on techniques and strategies to handle multiple developers and deployment of a Drupal project from development to staging to production.
My primary interests in DrupalCon this time are:
- The deployment problem mentioned above, how modules like features and deploy can help, and other strategies when those modules can't help.
- Drupal For Facebook (a.k.a. DFF), and the challenges of writing Facebook applications using Drupal.
- All the new goodness of Drupal 7, which is currently in Alpha.
- Meeting lots of cool Drupal peeps!
I am also going to the F8 conference on Wednesday, 4/21, and will be interested in learning as much as I can about developing applications for the Facebook platform.
This will be a very full week, but I hope to post at least a couple of entries about these two conferences while I'm here.