Skip to content

Attempting to understand the Drupal 7 Media module

2 min read

The Drupal 7 Media module seems like a step in a really good direction for handling media files and providing an improved user-interface. However, it feels unfinished to me. The format options provided by the module in a WYSIWYG editor like CKEditor don't appear to be very customisable.

In an attempt to try and get my head around how the Media module format options work I recently sat down and tried to work my way through the media setup from a minimal Drupal 7 install. I thought I'd post my notes here for future reference. Perhaps they'll help others understand things, or maybe someone out there can shed further light on things.

  • Currently there doesn't appear to be a way of controlling the options in the format options list
  • Link, preview and large are defined by the image file display options (File types > Manage file display); from a minimal Drupal install with the Media module enabled these are set as:
    • Link (no display)
    • Preview (image display using the square thumbnail image style)
    • Large (image display using the large image style)
    • Original (image display in the original format)
  • Changes to the image file display options are reflected in the output of media from the Media module (although the format options list is fixed to link, preview, large and original); so to make the link format work, from the display options set link to output something, for example "URL to file"
  • Changes to the file display types may need the cache to be cleared to be seen on the site
  • The difference between file types display and image styles is that file types decide how to display a file whereas image styles manipulate an image for display based on the file types display

Hope this helps some of you and removes some of the mystery surrounding the Media module. Hopefully there will be some further development on the module and things will start to work better soon.

© 2024 Andy Carter