Drupal 6 JavaScript and jQuery

Drupal is getting a hotter and hotter topic by the day. This is proven by the amount and the diversity of books being published about it. There are beginner books, advanced books, the ones with a more hands-on approach. There are books about module development, theming, ... But the most significant proof that Drupal is hot is that some books are available already that cover only a small topic of Drupal like security, views and now also JavaScript and jQuery. And it are those latest few that are the most appealing from my point of view.

In particular I've been really looking forward to Matt Butcher's Drupal 6 Javascript and jQuery. This book covers JavaScript and jQuery from a Drupal point of view. Drupal already opted very early for jQuery as its preferred JavaScript framework. In time, Drupal added another library on top of jQuery (Drupal.js) that gives Drupal themers and module developers a range of tools on the JavaScript layer to translate strings, use some kind of theming (like the "PHP one"), easier work with AJAX, ... These things aren't covered very well (yet) in the Drupal handbook and API. This book fills this gap.

Although this book is mostly targeted to people having experience in Drupal theming and module development, it starts off with a chapter that describes Drupal's architecture, module design, node system, users, blocks, ... This will mostly be interesting for themers to get a bit deeper in on some lower level concepts. The chapter ends by introducing you to some JavaScript development tools. This should get you up to speed to finish the follow the rest of the book.

After all this you'll get an extensive overview of what's possible with JavaScript/jQuery in Drupal land:

  • How to load JavaScript files in Drupal and how the jQuery framework is loaded.
  • An overview of drupal.js library.
  • Using behaviors to react to events.
  • The available utility functions like Drupal.checkPlain, Drupal.parseJson, ...
  • JavaScript level translations with Drupal.t.
  • JavaScript level theming with Drupal.theme.
  • AJAX with Drupal and jQuery.
  • Writing jQuery plugins.

All the concepts being touched upon are illustrated with really nice example projects. These aren't the simple "hello world" ones (although that's in there too), but are really usable stuff that get you up to a "pro" level. Some examples:

  • Printer-friendly page content
  • Rotating sticky node teasers
  • Collapsing blocks
  • Simple text editor
  • Creating and using templates for JavaScript
  • Web clips with RSS and AJAX
  • Real-time comment notifications
  • Autocompletion and search
  • Writing a jQuery plugin

Is this book for you?

Although this book is a good read for both people with little experience and those with a lot of experience in Drupal, you may find yourself skipping one or two chapters if you already have some Drupal module development or theming experience. If you always wanted to use JavaScript/jQuery in your Drupal projects this book is for you. And even if you already have some experience in the JavaScript/jQuery area, this might be an interesting read to you to learn what the Drupal way of doing it is and what tools Drupal provides on the JavaScript level like translation, theming, behaviors, ...

Read an excerpt chapter

In order to help promote the book, Packt Publishing has provided a free download of Drupal 6 JavaScript and jQuery’s second chapter: Working with JavaScript in Drupal.

Written on January 03, 2010 at 14:34, tagged as books, Drupal, JavaScript, jQuery, reviews

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

About

drupalcoder.com is a blog on all things Drupal in specific and LAMP on OS X in general. It is maintained by Davy Van Den Bremt, a Belgian (Drupal) web developer and designer living in Ghent. The goal of this blog is to log all interesting things that have crossed the writer's path while developing Drupal sites. You can read all about Davy's professional activities on his LinkedIn profile. If you want to get in touch, use the contact form.