Book Review: Learning Drupal 6 Module Development

Title: 
Learning Drupal 6 Module Development
Author: 
Matt Butcher
Publisher: 
Packt Publishing / Birmingham
First published: 
May 2008
Pages: 
328
ISBN: 
978-1-847194-44-2
List price: 
€24.99

Drupal is a very powerful and feature rich content management framework with hundreds of contributed modules, extending it's core functionality. However, even with all of those third party add-ons, a lot of website owners will sooner or later find themselves in a situation, where a desired service can only be implemented by creating a custom module.

When it comes to module development, Drupal's biggest advantage is also it's biggest disadvantage. The content management framework sports a powerful, albeit complex API as well as a large number of conventions, best practice guidelines and several layers of abstraction. While these concepts are what gives Drupal it's flexibility, they can also be difficult to grasp for novice developers, who is looking for a starting point.

In "Learning Drupal 6 Module Development", Matt Butcher sets out to provide a comprehensive guide for Drupal module development, aimed specifically at the novice developer, who is struggling with the official documentation.

Structure and content

"Learning Drupal 6 Module Development" takes the "teach by example" approach. The book is organized around a single project, that uses Drupal and the to be developed custom modules to build a website revolving around a database of philosophers.
The general chapter structure is to outline it's objective first, present an implementation for a given problem and than discuss that implementation in detail.

Chapter one starts with introducing Drupal's architecture and concepts from a developers point of view. The reader is suppose to be already familiar with setting up and running Drupal websites.

Chapter two directly jumps from theory to practice, by demonstrating how to implement a first, "hello world" style module, that provides a block displaying content from off site XML feeds.

Chapter three briefly changes the topic from module development to theming, in order to prepare the grounds for themeable modules.
The two core aspects of module theming, proper output generation and integration of extra CSS in Drupal is than discussed in chapter four.

Chapter five essentially is the short version of Matt Butcher's other book "Drupal 6: JavaScript and jQuery". It mainly deals with using the JavaScript libraries, that come with Drupal for providing AJAX/JSON services.

Chapter six changes tracks, focusing on data input instead of data processing. It introduces the reader to the Forms API, access control and how to hook modules into the administrative menu.

Chapter seven returns to the content level by showing how to define custom content types with additional input fields. It also discusses the database abstraction layer.

Chapter eight is the last chapter, dealing with actual module development and rounds up the previous chapters. It broaches the issue of modules interplaying with other parts of the system by showing how triggers, actions and input filters can be used for creating and sending newsletter from nodes.

The final chapter of the book is dedicated to module deployment through the "installation profile" mechanism.

Conclusion

"Learning Drupal 6 Module Development" is a well written and easy to understand guide to module development. The chapters are clearly outlined with learning objectives, code examples and discussion. The book covers all topics needed for starting module development and is a big time saver compared to trying to learn the same skills from the Drupal website.

Two things are worth mentioning as not entirely satisfying:

  • The deployment method, introduced in chapter nine is arguably a bad choice. Installation profiles imply building a custom Drupal distribution. Custom distributions of any software always raise the problem of keeping them in sync with the official sources. Also, installation profiles are run during the installation process, before the CMS actually becomes fully operational. This means, that they are not necessarily compatible with all modules. Both issues severely limit the usefulness of this deployment method.
    It might have been better to dedicate this chapter to CVS access to the official module repository on the Drupal website or at least mention it as another option.
  • A core aspect of Drupal is to manage content, kept in a database. Even though databases and working with the database layer is covered to the required extent, a more in depth discussion of this important topic would have been desirable.

All in all, "Learning Drupal 6 Module Development" is money well spent. I'd recommend this book to experienced Drupal webmasters, wanting to enhance their website with extra functionality, that is not available through stock modules and who are looking for a point to start.