The MIE Toolbox, a Case for Drupal as an Application Framework

We all know Drupal can be a great out of the box content management solution, blogging platform, or social networking site. Especially when you take into account tools like CCK and Views. But what if you need to develop a more customized and focused application? Where does it make sense to use a more generalized and lower level framework like CakePHP or Rails? I don’t know if there’s a single answer to that question, certainly lots of opinions, including my own which I discussed at Open Source Bridge. Namely, the more singular the purpose of an application, the less it makes sense to use Drupal.

I’ve had the pleasure of working with One Economy the last couple years on several projects, including http://pic.tv, http://one-economy.com, and, most recently, the Make it Easy Toolbox. This last project fell under the gray area of being a good fit for Drupal, and, together with the One Economy team, we decided to give it a go. The application is still in active development, but so far so good.

What is the MIE Toolbox?

The MIE Toolbox is a CMS for distributing viral widgets around the web. A widget is distributed by inserting a javascript tag on a web page, referencing a given toolbox ID. The application than returns javascript which manipulates the DOM adding the toolbox content, CSS, images, scripts, etc. It consists of:

  • Toolbox, the core component of the system which is a container for all other items and is used to render the widgets.
  • Toolbox Themes, reusable styles applied to toolboxes
  • Basic Toolbox Items, where content is entered directly
  • RSS Toolbox Items, where content is pulled from a remote feed
  • Resource Locator Toolbox Items, which integrates with One Economy's RL API and presents users with a zip code entry form. Results are returned via AJAX and displayed in the toolbox item.

Background & Business Case

The first version of the Toolbox was developed using CakePHP, a very admirable PHP MVC framework. It was rough around the edges, though, and One Economy had much bigger plans for it. We began discussions on the next version, and initially were going to build on the existing system, still using CakePHP. Early on in the process, though, we kept seeing things that could be so easily handled by Drupal, yet required substantial work when developing from scratch. Finally, we held our collective breath, changed directions, and started over in Drupal. The main concerns were around CRUFT, scalability, and whether it would take more effort to do things the "Drupal way."

How Drupal Was Used

From the beginning an emphasis was placed on a light foot print, so we only enabled a handful of core modules. Side note, I fully support the current small core movement within the Drupal community. Drupal excels as a nimble and lightweight application platform, not as a catch all plug and play system. We used the following contributed modules.

  • admin_menu: Ease system navigation for CMS users.
  • CCK: Allow custom fields for toolboxes, toolbox themes, and toolbox items
  • colorpicker: Visual color picker for theme colors.
  • feedapi: API module for processing RSS feeds for feed toolbox items.
  • filefield: CCK filefield needed for image upload. Required by imagefield.
  • filefield_sources: Allows for the reuse of files for CCK filefields.
  • imageapi: Required by imagecache and imagefield.
  • imagefield: CCK field for uploading images.
  • imagecache: Creates image presets by processing uploaded images on the server. Used for toolbox item headers.
  • imce: Image browsing and uploading from the WYSIWYG editor.
  • imce_wysiwyg: Integrates IMCE and WYSIWYG
  • node_clone: Allows for the cloning of nodes.
  • views: Foundational module for creating lists of items. Used for organizing content in the CMS.
  • wysiwyg: Rich text editor for text areas.

And a handful of custom modules, which did most of the work.

  • feedapi_toolbox: Custom processor built on top of the feedapi, storing feed items in a lightweight custom schema rather than as nodes.
  • toolbox: Defines content types for toolboxes and toolbox themes, caching mechanism, generates the embed code, and provides a link checking mechanism which is run during cron.
  • toolbox_reports: Generates and displays reports for toolboxes and toolbox items.
  • toolbox_rl: Defines a content type for resource locator toolbox items, integrating with the RL API
  • toolbox_widget: Controls the rendering and display of the toolbox

System Diagram

Benefits

Namely, we got loads of functionality for little development cost. This included, but was not limited to:

  • Reuse of toolbox items and themes across toolboxes via node reference
  • Role based security model for system administration
  • Basic information architecture for the CMS using a contributed theme, Zen
  • Simple way to create fields for the toolbox items using CCK
  • Administrative views of all content using Views, including exposed filters
  • Image upload and manipulation using Imagefield and Imagecache

In addition to these technical benefits, One Economy has a talented team of experienced Drupal developers who could work on the system and they were already using Drupal on several sites so had experience with administering and running Drupal.

Drawbacks

Not many, to be honest. But to be fair and balanced, I feel I need to give it a go.

  • There were some square peg / round hole situations, such as when we used the taxonomy system to manage toolbox items statuses. In our case, status included such things as bad links. It ended up working well, and technically is a content classification, but not an obvious path to go down nonetheless.
  • We were a very experienced Drupal team, so all things Drupal were second nature to us, from development best practices to administering the site. I'm not sure I would recommend this approach if that wasn't the case. The Drupal learning curve is very steep, especially for more complex applications.

About One Economy

One Economy uses technology and information to enhance the lives of low-income people. We believe the quality of information directly affects the quality of one's life, and that improving quality of life depends heavily on access to technology.

The Public Internet Channel is part of a network of sites from One Economy Corp. PIC.tv uses high-quality multimedia to engage and inspire users, leading them to life-enhancing tools and information ranging from disease management, to surviving the recession, to living a more sustainable life.

The Make It Easy Toolbox provides the link between PIC.tv's inspiring programming and the Beehive's life-enhancing tools and resources. It is present next to every piece of video on PIC.tv, and soon will be syndicated across the Web through partner and other media sites to enhance the information and resources they already provide to their users.

???

If you wanted a small footprint, why use CCK and Views? They are megalithic and extra overhead.

Fair enough

But it was a trade off with the development effort in doing it all custom. The content types are hybrids between pure custom and CCK fields, and the Views are only used for administrative lists. Neither effects the performance as they're by-passed when a widget is rendered.