September 29, 2009

A Look at the Drupal Features Module

When developing a Drupal site, there's a constant sense of deja-vu. "I know I've done this before!" As with many things in life, it becomes a race to do it faster this time than you did the last.

For small chunks of code, or "snippets", there are many tools a developer can utilize to ease the repetitiveness of coding. Editors, such as Textmate, offer developers a built-in and customizable arsenal of code routines that, when used properly, make life a whole lot easier. (Check out the Textmate PHP Drupal bundle).

For larger aspects of a development project, however, the task of harnessing re-usable code becomes more complicated. Also, there is a fair amount of site configuration (read "mouse clicks") needed to set up even one section of a Drupal site.

Take, for instance, a directory of people that includes a listing page and individual bio pages. When approaching this using Drupal, there are many components involved. Furthermore, there are many ways a Client could request the data be presented -- the Client may want to break people up into various groups, create a glossary-style listing with alphabetical pager links, or what-have-you... However endless the permutations, there is a common thread; there is a shared foundation of code and logic that can be re-used. The Drupal Features module seeks to provide that foundation, and so far, it's looking rock solid.

Still in beta, the Features module bundles one site aspect, which may depend on components of various modules, as a package of code, which can be deployed over and over again. Then, once deployed, the site aspect can be customized to meet the needs of that particular project.

This may sound a bit abstract, but let's go back to our example above: the directory of people. The developer sets up the essentials: the basic content fields that describe a person (name, bio, picture, etc.), the taxonomy terms that group people together, and the logic that presents a list of people in alphabetical order. He or she then uses the Features module to package these essentials into a bundle of re-usable code. The next time a directory of people needs to be set up, the packaged "feature" can be deployed, providing the basis for a directory listing. With that as a starting point, the site's developer can go in and customize the various components to meet the needs of the Client.

I've used the Features module a bit, and my initial impression (as you can probably already tell) is that this module is well on its way to becoming a powerful time-saver in Drupal development.

Posted at 10:15 pm by DPCI Bloggers


More Blogs From Author:

Case study:
DPCI Builds pointclickhome.com shelter portal site

DPCI built a Drupal-based Web content management system that drives PointClickHome.com, the umbrella site for all magazine properties of Hachette Filipacchi Media's Shelter Group. > more

All case studies


Press Release:

DPCI Nominated as an Adobe Digital Publishing Suite Reseller
DPCI will focus on implementation, training and support services as well as integrating Adobe Digital Publishing Suite with InDesign Server, K4 Publishing System, and customer Web content management and digital asset management systems. > more
IDEAlliance Bulletin: "One Size Fits All? Not in MultiChannel Publishing" Lead Article by DPCI CEO Joe Bachana > more

DPCI Events:

DPCI a Bronze Sponsor of Drupalcon Denver 2012
Come visit us in the exhibition hall, see the work we have done around integrating Drupal with Entermedia DAM and InDesign Server, and get some SWAG and chocolate on us! > more
DPCI R&D Team to Present InDesign Integration with Drupal at DrupalcampNJ
Members of the DPCI R&D Team will present integrations we have accomplished between Drupal 7 and both InDesign desktop and server software. > more
Alltop, all the top stories