I managed to get my hands on a pre-release version of a new Drupal book that just came out this week. The book is Front End Drupal and it is written by Emma Jane Hogbin and Konstantin Kaefer. The book says on the cover, Designing, Theming, Scripting, and I'm excited to see another book that really gets into Drupal 6 theming. When we, at Lullabot, wrote Using Drupal and we had to draw the line at a basic intro to theming, I was looking for a book to carry that forward. Since I am lucky enough to have myself a copy and found some time to sit down and read it, I thought I'd share my thoughts for those that may be trying to decide whether to order it (short answer is "yes").
To properly orient this review, I should start off by saying that I know Drupal theming pretty well, so my take on things may be a bit different from someone who is totally new to theming. I've also taught a lot of folks though, on every part of the learning curve, so I can appreciate what it means to get some of this stuff to click for people. The book tells you at the start that you shouldn't be a total Drupal newbie. This book is about getting Drupal to look the way you want, but it expects you to bring some basic skills to the table. Now, that said, the first few chapters do take the time to get you oriented with Drupal; so if you are rusty, you get a refresher, and if you are cheeky and like to scoff at "prerequisites," you at least get a toe-hold of the basics before being whisked into the heart of it all. So, off we go.
As I started into it, the first thing that I noticed was that this really is not about "just" code. I was expecting to get dumped right into some hacking and instead, you are given some good groundwork first. While the first two chapters would be the stuff I'd normally skip, I'd advise reading them, especially if you are new to Drupal or dynamic web sites in general. If you are a know-it-all, then I suggest you at least skim the headings and make sure you actually know what you think you know. The first chapter covers a lot of the basics of WTH are you even doing when making a website. These are generally good things to think about and go through even if you aren't theming. Stuff like, what kind of content are you really going to need, how do things need to be listed, who will be using it and how? The chapter walks you through the questions and talks about them from a Drupal perspective. You really should think about your site before you dive in willy-nilly. After you get your head into the proper space about what you are building, chapter 2 covers tools. This covers the gamut from a CCK and Views refresher, to cron and using version control. Basically, it is packed with a really complete checklist and you'll save yourself time and frustration if you take some time to go through this chapter and get yourself comfy.
Chapter 3 is where you start to learn about Drupal themes themselves. After a bit about how to install and configure existing themes, you get to make your first theme. It walks you through multiple ways to get started; using a contributed theme, making a theme from scratch, upgrading a theme from Drupal 5 to Drupal 6, or even how to convert a theme from Wordpress or Joomla!. I was surprised to find some of this more "advanced" stuff like upgrading or converting so early in the book. I would have expected it to be in the appendix instead, especially since some of the things it refers to haven't really been covered yet, or are really not likely. Not many people start with theming by upgrading a theme from 5 to 6, but they definitely would want a handy reference for it later if they need it. On the other hand, I can see that covering how to move from another system would be a more comfortable way for some people to start off. One thing that would be nice for those sections is to provide more detailed references right there (e.g. a link to the Drupal.org theme upgrade or variables docs). That way folks can come back to that chapter later and use it as a more one-stop shop for that kind of work later.
Once you have the basics down, the next few chapters take you into the major building blocks of themes by looking at the overall page (and things like blocks, taxonomy, search, etc.), as well as getting into content (nodes, CCK and Views). This is the nitty-gritty of what all these template files are for and how to crack them open and get them doing what you want. Sprinkled in here is a section on getting images into your content. It doesn't really do the full pointy-clicky work, but it does point you off to the various techniques to look at, like Image vs Imagefield.
Related to content, but in a whole chapter of its own (rightly so), is a really nice guide to working with Drupal forms. Output is great, but what about those pesky input forms that are the workhorse of administering your site? Again, this chapter has solid code examples and explanations, along with more module discussion about things like WYSIWYG editors. From there the book goes on to cover other important things like users and profiles, with a bit about controlling various things in this realm with regards to things like permissions and spam. The admin interface chapter is very module heavy and looks largely to modules that can make your admin's life a little easier, with some theme tweaking thrown in for good measure. Definitely a very pointy-clicky chapter more than codey.
Ok, so long review already, but there is definitely a lot of stuff in here. I expected a "theming" book and got more than I bargained for. At times some of the things that had more to do with modules and configuration would surprise me, but then again, the front end of a website is more than just the theme, it is all of the pieces that play a part in both look and feel. So, while I found it surprising, I don't think it is off-base and honestly for people who are new to Drupal this is a freaking gem. Don't think that this is only for newbs though, not at all. This is a serious book, made for grownups, and it expects you to be able to extrapolate from examples and make use of the references you've been given. To my mind that is the only way to really learn this stuff. The chapters give context, some conceptual framework, and points to the standard references, but then it dives straight in to real examples, and they aren't namby-pamby. Some examples are definitely doing some interesting stuff, but the great thing is that each part is explained step-by-step. This gives newbies some hand-holding while allowing more advanced folks to just get down to it and see what they can really do beyond the basics. Overall, a great book, jam-packed with lots of learning. Congrats to Emma and Konstantin for producing another great book in the Drupal library.