Drupal Media: a new approach to rich content

(notes from a session at DrupalCon 2010)

Media module is already in use at Drupal Gardens; only available for D7.

After 10 years, still no good solution for adding media to Drupal 6 content

  • too many modules to choose from, no single easy solution
  • file field and WYSIWYG don't play well together
  • hard to integrate different kinds of content, so we have video, image, audio modules and so forth
  • end user experience sucks - procedure for adding rich media is different in every instance; layout is limited; other platforms (such as Wordpress) beat Drupal across the board.

how Wordpress does it

  • set of buttons above WYSIWYG editor for inserting media
  • can select from existing library (including search feature), Flickr and other external sites, with consistent interface.

Where are we with Drupal 7?

  • Filefield and Imagefield in core, slightly more consistent interface
  • imagecache in core (styles and sizes)
  • huge improvements in stream wrappers (more on that below)
  • but there's a lot of room for improvement! content is treated differently by medium, file management is largely absent.

Media module provides a common framework so contrib developers to focus on formatting solutions

  • in development since October 2008
  • Media Module is different because files are files, with a unified interface.
  • Stream wrappers = a structured way to represent streamable (non-local) resources, allowing local and remote files to be treated the same way.  URLs are stored in the files table of the database.

Demo at http://drupalmedia.org

  • WYSIWYG integration - just click button to pop up media browser
  • when a file is embedded in a node, it gets a record in the files table, so you can track how/if/where a file is being used
  • admin/content/media screen displays all files
  • alt text is handled per instance, since it's HTML
  • mass import from a folder at content/media/import
  • media files are entities and can have fields (admin/structure/media), but a file is also a field that can be attached to other entities (including other media files)

how to make a media browser plugin

  • hook_media_browser_plugins
  • need Drupal head and media module head, ckeditor with wysiwyg module
  • install profile: project/media_dev
  • need contrib developers to get behind this project!  No more reinventing the wheel!

There will not be a backport to D6 because the necessary infrastructure isn't there. Upgrade from D6 to D7 will almost certainly be tough.

Taxonomy upgrade extras: