Review: Drupal Multimedia

Posted on May 21, 2009 by agentrickard

Drupal Multimedia
Drupal Multimedia, by Aaron Winborn, Packt Publishing, 2008

Drupal Multimedia covers the use of audio, video and image files within the popular Drupal open-source content management framework. The book is aimed at site architects, themers and Drupal developers, with an emphasis on those new to the platform.

Packt sent me a copy of the book for review, and I think that is an important statement. I would not have purchased this book otherwise, mostly because I have been using Drupal since 2004 and am familiar with the challenges and solutions discussed in this book. That said, I did learn some new tricks (jQuery Media, Dash Media Player), and I have tried to approach my final review as if I were new to Drupal.

Let me start the formal review by praising Winborn’s depth of knowledge and commitment to Drupal and the issues regarding media handling. In fact, I use some of Aaron’s work on every site that I build, and his contributions to hook_file() should make multimedia in Drupal 7 even stronger. This book, however, is about how we can put Drupal to work today while building sustainable web sites.

The collaboration on media has been a little contentious in the Drupal community – something Winborn deftly covers in Chapter 11, which covers the road ahead for media handling and reviews some of the challenges yet to be solved. The basic problem boils down to this: Drupal core does not have a media handling solution, and individual developers have tried to craft solutions for their specific problems. Making those solutions workable for the majority of use-cases is a great challenge. A good example of this is found in chapter 10, in the discussion of a specific solution for AirAmerica.com that leverages common solutions but still requires custom code. (An aside: the audio chapters of the book are probably the strongest section, though Winborn rightly notes that audio is often the overlooked medium in the multimedia mix.)

The book itself treats it material insightfully, with a strong organization and chapters that logically build on each other. Chapter one offers a crash course in Drupal basics and introduces some tools and concepts that are essential. It is important to note that the chapter begins with a succinct explanation of the Drupal philosophy that “the webmaster is dead”; the idea being that non-technical people should be given the tools needed to build a good web site without leaning the sometimes arcane nuances of the acronyms of the profession: HTML, LAMP, FTP, CSS and so on. Drupal and its developers strive to build a platform that can survive without them.

The problem, especially for the complex use-cases for multimedia presentation and storage, is in crafting solutions that can be configured rather than coded. Winborn does a commendable job explaining the factors that influence module selection, which is a critical topic given the state of uncertainty that revolves around file handling in Drupal.

And the rest of the book is largely given over to discussions and examples of how to select, install and configure various modules (Image, ImageField, Audio, MediaMover, Embedded Media Field, Lightbox 2) to accomplish specific tasks, like the building of a photo gallery or displaying an audio playlist. The solutions are sound and well-established best practices, and they should give the new user some firm footing to begin adapting Drupal to meet her needs. The book, rightly, makes clear that some customization through code will be likely, and there are some long passages devoted to theming the final HTML output that the new Drupaler should examine carefully (chapter 6 has a good example).

What will a new reader learn to do with this book? Here’s a quick list:

  • Assess a site’s media needs and select appropriate Drupal modules.
  • Display images within site content.
  • Create multiple image galleries.
  • Display images from Flickr or other third party hosting services.
  • Understand how to theme image display for Drupal.
  • Display video files hosted on BlipTV, Brightcove or other third-party services.
  • Display and host video from a local server.
  • Select a cross-browser media player.
  • Host media files on external services.
  • Upload and display audio files within site content.
  • Create and display audio playlists.
  • How to work with the Views module to create media galleries.
  • When and how to customize existing Drupal solutions for media display.
  • How to contribute to media handling in Drupal.

These topics are largely given equal treatment, and the style of the book is familiar and consistent, making for an easy read in as little as two hours.

There are some clunky moments in the book, such as two sections on User Images and the Taxonomy Image module that are unrelated to the rest of chapter 3 (but seem to have no home elsewhere in the book). The proofreading slips in a couple of cases (most blatantly on page 174), and the index is so thin that I was frustrated by it (security, GIMP, XSS and Zen are all missing.) On page 98, we suddenly jump back from Views 6.x.2 (used throughout the book) to Views 5.x.1 with no explanation.

There are also some implementation decisions I would argue with – especially using menu IDs (which are volatile and can be changed in the UI) as CSS class names in the CSS example on pages 120-2. And some strong concepts are missing – such as the way Embedded Media Field can be used with FeedAPI to automatically pull content from a YouTube or BlipTV RSS feed to create content on your site. The theme override tricks discussed on pages 104-5 are specific to Drupal 6 and, in my opinion, a non-standard solution to the problem at hand. That type of solution is generally handled at the theme layer without the need for hook_theme_registry_alter(). To his credit Winborn seems to be showing each of the options available to developers in the different examples – using module-based themes, template.php, preprocess theme functions, *.tpl.php files -- but this approach is not made clear and leaves me wondering why certain approaches are used at different times.

Most glaringly, I think the issue of security when dealing with files is not handled properly. The relationship between the IMG SRC tag and XSS attacks is a little arcane, and it needs a section early in the book to explain exactly why Drupal is so sensitive to user input. While the filter system (called Input Formats in the Drupal administrative interface) is covered in the book, that coverage is scattered and not grounded in a clear discussion of the security issues involved with allowing media uploads to your server and embedded media links into your content (the former issue is not discussed at all, as I recall; and the two issues are definitely not interchangeable).

Still, the coverage in the book is strong, and I would particularly encourage new developers to explore the Embedded Media Field (which is itself a secure solution to the problem of media files) and the FileField/ImageField combination when building (or testing) a Drupal site. One of the issues that the new developer will face, however, Winborn clearly states (numerous times): some solutions were only available for Drupal 5 (AcidFree Albums, MediaMover) at the time of writing, and may or may not be ready for Drupal 6. This issue is a common one in open source, and something that Drupal users will need to prepare for – most successfully by being an active member of the community, a theme that Winborn returns to continually.

How would I rate this book overall? For me, I think the book is a necessary one: it covers a topic vital to Drupal sites, and it gives a good overview of the issues and solutions available. But I don’t think the book is a vital addition to my personal Drupal library. However, that statement should be qualified by the fact that, for instance, I have seen presentations and demonstrations of modules like Asset and MediaMover at DrupalCONs (annual Drupal user conferences in North America and Europe each year), and I have used many of these modules in production on sites like ForeignAffairs.com.

Given that the cost of the book easily comes under the cost of attending DrupalCON Paris (September 2009) and provides a worthy introduction to the topic, I would recommend the book for those new to Drupal, with a special note to those who may have inherited the support of a Drupal-powered web site, since the book will help you to understand why certain decisions have been made about how the site was constructed.

PBS Engage asks ' What are your information needs?'

Posted on April 29, 2009 by agentrickard

We are gearing up for next month's PBS Engage advisory board meeting. And beforehand, we're talking a bit about what people actually need from their media.

The Knight Commission on the Information Needs of Communities in a Democracy and PBS Engage have teamed up to explore the issues around each citizen's information needs, and we would like to hear from you. See the Commission's draft introduction to its report and please share your answers to our questions.

And while this isn't directly about Drupal, I think that our community has some ideas about what information freedom means, and how to get us pointed in the right direction.

Domain Access update: new co-maintainer

Posted on April 7, 2009 by agentrickard

This morning I added Katrin Silvius (also known as nonsie) to the Domain Access project as a co-maintainer. This is a big step forward for a couple of reasons.

1) She's great. We finally had a chance to meet at DrupalCON DC. And she has already released Domain Blocks and Domain Relationships extension modules.

2) I am swamped, and behind in getting out the stable 2.0 release -- (though rc6 is perfectly fine, it still has some rough edges).

3) Upping the bus factor of a project is always a good thing.

4) And this may be most crucial: nonsie runs DA on a daily basis, managing over 110 sites from one install. This gives her a perspective on usability and scalability that I simply don't have. (The largest site I am currently involved in has 6 domains). Plus, she needs to supply internationalization (i18n) support to her project, which is a critical DA feature.

So this should mean that a stable release comes out sooner _and_ that the code will be more stable and road-tested. It also means that we can start the D7 port sooner.

For those of you interested in the project, here are the issues that are holding up a stable release:

http://drupal.org/node/319876
http://drupal.org/node/266071
http://drupal.org/node/252877
http://drupal.org/node/405148
http://drupal.org/node/300454
http://drupal.org/node/303406
http://drupal.org/node/359037

I am excited, and looking forward to the collaboration!

Knight Drupal Initiative: $480,000

Posted on March 5, 2009 by agentrickard

At DrupalCON DC yesterday, Jose Zamora of Knight Foundation announced the first round of grants from the KDI. Below is the press release from Knight:

WASHINGTON, D.C. -- Six ideas that will make it easier for anyone to join the digital conversation will be realized with support from the John S. and James L. Knight Foundation. The projects will use the free and popular software Drupal, which allows users to efficiently publish content online.

"These powerful tools will help people exchange information and ideas about their communities -- which we hope will make them more engaged and vibrant places to live," said Jose Zamora, Knight Foundation's Journalism Program Associate.

The Knight Drupal Initiative's winners, announced at the DrupalCon DC Conference, will receive a total of $485,380 to:

* Create concise, up-to-date instructions for Drupal software packages so that tech novices can use the tools; (Winner: Programmer Addison Berry)

* Create a free publishing system to make it easier for several geographic communities to share local news with each other; (Winner: Oregon-based funnymonkey.com)

* Allow anyone, anywhere to easily create a Drupal online news site whose content can be published on Facebook in order to reach an extended social network; (Winner: Software developer Dave Cohen)

* Develop software that allows people to create and share a personalized stream of information within their social network, helping them to filter and recommend articles to others interested in the same issues; (Winner: Instant Syndicating Standards, a Brazilian non-profit)

* Add a micro-blogging function to Drupal that will allow users to transmit brief text updates on their Web sites (Winner: Web developer Rob Loach)

* Create a tool that will help residents better communicate and understand information about their community by allowing them to geo-tag -- or add a geographical identification -- to stories so they can be displayed on a map; (Development Seed, a Washington D.C. firm)

The Knight Drupal Initiative tapped into a massive network of programmers, to get their recommendations for how to hasten media innovation for the common good. The Drupal Community, a group of about 350,000 programmers who write free software collaboratively on the Web, solicited, reviewed and recommended the projects for funding. The Drupal Community also includes the more than 1.4 million users worldwide who rely on Drupal to manage the content of their Web sites. The application process was open, meaning anyone could submit or vote on an idea. Knight Foundation made the final selection.

About the John S. and James L. Knight Foundation

The John S. and James L. Knight Foundation invests in journalism excellence worldwide and in the vitality of U.S. communities where the Knight brothers owned newspapers. Since 1950, the foundation has granted more than $400 million to advance quality journalism and freedom of expression. Knight Foundation focuses on projects with the potential to create transformational change. For more, visit www.knightfoundation.org.

What can I say, but "Wow." I am especially excited about the Documentation sprint, which will directly benefit drupal.org.

Actions and triggers (who knew?)

Posted on February 27, 2009 by agentrickard

Well, the folks who put Actions into D6 core did. But until yesterday, I had never bothered with actions. Then a client asked for the following:

For certain user roles, any new or edited posts of certain types need to be unpublished and queued for editorial review.

My first thought was: "Well, Drupal doesn't do that." But it does. Thanks to Actions. Here's a little code snippet for you, and it works.

/**
* Implements hook_perm().
*/
function custom_perm() {
$types = node_get_types();
foreach ($types as $type => $data) {
$array[] = "edit $type content without approval";
}
return $array;
}

/**
* Implementation of hook_action_info().
*/
function custom_action_info() {
return array(
'custom_unpublish_action' => array(
'type' => 'node',
'description' => t('Unpublish posts by untrusted users'),
'configurable' => FALSE,
'behavior' => array('changes_node_property'),
'hooks' => array(
'nodeapi' => array('presave'),
),
),
);
}

/**
* Implementation of a Drupal action.
* Sets the status of a node to 0, meaning unpublished,
* if created or edited by an untrusted user.
*/
function custom_unpublish_action(&$node, $context = array()) {
// If the user is allowed to edit, let them.
if (user_access("edit $node->type content without approval")
|| user_access('administer nodes')) {
return;
}
// Otherwise, unpublish.
$node->status = 0;
drupal_set_message(t('Your changes have been saved. This content
has been sent for administrator approval. Until it is approved,
this page has been removed from the web site.'));
watchdog('action', 'Set @type %title to unpublished.',
array('@type' => node_get_types('name', $node),
'%title' => $node->title));
}

And that's it. I can't believe it took me this long to exploit this feature.

And I just know that I'll learn all sorts of new tricks at DrupalCON next week, so see you there!

Stealth mode

Posted on December 4, 2008 by agentrickard

I haven't posted in quite a while. Well, I have been very busy working on very cool (but still secret) projects for Palantir. I also just set up my new desk / workstation. I had to change gears and get an adjustable height table to work on, since I am too tall for most keyboard tray / desk combos.

In the meantime, go find something interesting to read over at Looky, Daddy! -- a parenting blog written by an old college pal o' mine. Or, if you're more serious, go see what Yelvington is up to.

On the plus side, the house repairs are all but done. The new fence should go in next week. And then we are done done.

KDI proposals recommend $178,000 for Drupal development

Posted on October 2, 2008 by agentrickard

The October review meeting of the Knight Drupal Initiative saw three new proposals accepted by the community.

KDI logo

These proposals have been passed to Knight Foundation for final review and potential funding.

The Knight Drupal Initiative is an ongoing, open grant funding process for the Drupal open source project. We want to enable more people to enter the digital conversation by lowering the technical barriers to entry. We will provide powerful tools for digital publication, free and open to all. Our goal is to encourage people to improve their communities by supporting the free exchange of information and ideas.

For more information or to learn how to apply, see http://groups.drupal.org/knight-drupal-initiative

LOL

Posted on September 30, 2008 by agentrickard

For those of you who like this sort of thing....

loldog.jpg

Caesar and Mina are very excited to have their floors and furniture mostly back in the right place now.

Woo hoo

Posted on September 29, 2008 by agentrickard

So today, we finally got our furniture back. It almost looks like our house again.

If you look closely at the fireplace, you'll see the new art we bought last week. Ironically, its a painting of three trees.

I have also included a bonus picture of some happy dogs, who now have their house back.

img_2263.jpg

img_2265.jpg

img_2266.jpg

img_2267.jpg

img_2269.jpg

More floor

Posted on September 23, 2008 by agentrickard

Well, we had quite an adventure with the floor install. The product line was discontinued, and the batch we got wasn't milled right. But the team from Lindsey's Flooring hand-milled the grooves between the boards, with permission from the Armstrong distributor, so the warranty is still good.

Some shots from today. They should finish tomorrow.

img_2258.jpg

img_2259.jpg

img_2261.jpg

Buy the Book

Buy your copy of Drupal 7 Module Development today!

It includes my detailed chapter on Node Access in Drupal 7.

Speaking Engagements

Contact me for availability.

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List