Drupal 7 First Look

Drupal 7 First Look

I recently finished reading Drupal 7 First Look - written by Mark Noble of Drupal by Example, and published by Packt Publishing. I have to admit what while I was interested in learning more about Drupal 7, I was a bit skeptical about a book entitled "First Look," concerned that perhaps it wouldn't be substantive enough. However, since I have generally been pleased with the books I've read from Packt in the past, I decided this one might be worth reading.

I'm happy to say that this book not only lived up to it's "at a glance" style title, but actually went into quite a bit of depth in several areas. While ideally suited to those who have some familiarity with Drupal 6, and want to know what's changed in version 7, I believe this book would also be a good intro for those who are just starting to get into Drupal.

Noble aptly covered many facets of Drupal, from basic site building — configuring different content types and whatnot — to the new database abstraction layer, and building custom modules. The breadth of this book, and depth of its chapters, certainly quelled any uncertainty I had about the book possibly being just a high-level overview.

Anyway, without simply running through the table of contents, I did want to highlight a few parts of this book that were particularly beneficial to me. Namely, just about everything in chapter 5: Drupal 7 for Themers. Being a front-end developer by profession, this was of particular importance to me, because though I had thoroughly learned the ins-and-outs of theming for Drupal 6, there are significant differences in version 7.

For instance, rather than page.tpl.php and/or page-specific.tpl.php being the highest level template, there is now an html.tpl.php file. This makes it a lot easier to have shared aspects across multiple page templates. Namely, things in the <head>, whereas in Drupal 6 this would have been repeated across all page level templates. Now you need only specify your CSS and JavaScript once in the html.tpl.php file.

Additionally, page templates for specific areas of a site now include two dashes.

  • page-specific.tpl.php (Drupal 6)

  • page--specific.tpl.php (Drupal 7)

Little changes like this were documented well throughout the book.

I also appreciate how Noble broke down the various parts of a page template, specifically calling out region.tpl.php as something that could be modified at the theme layer. This, along with block.tpl.php enabled me to greatly simplify my site's markup. Inspired by those quick wins, I even went so far as to revamp the output of the Views module, via the various views-*.tpl.php files it responds to.

Translation: My own site, powered by Drupal 7, now renders only the markup I have specified, with next to nothing auto-generated by Drupal. I would recommend Drupal 7 First Look to anyone looking to make the transition from Drupal 6 to 7, or those simply wanting a starting point for learning more about this robust CMS.