Hi, I'm Tim Millwood. I am a Web Developer from Abergavenny, UK, and work for Mark Boulton Design, specializing in Drupal. This is my blog!

Review: Drupal 6 Themes - Ric Shreves

Earlier in the year I was asked by Packt Publishing if I would like to review some of their Drupal books on my blog, obviously I jumped at the offer and quickly e-mailed back a big fat "YES". A week or two ago a copy of "Drupal 6 Themes" by Ric Shreves landed on my door mat, since then I have been working my way through the book and compiling this review.

Drupal 6 Themes was published by Packt Publishing in September 2008, it was written by Ric Shreves who is a partner at the Drupal development company Water & Stone in Bali. Ric also wrote Drupal 5 themes for Packt Publishing, which I have not had the chance to read.

The book is split into nine chapters, which nicely lead the reader through the Drupal 6 theme development process. Chapter one (The Elements of a Drupal Theme) assumes you know what Drupal is, but starts form the basics in regards to theming. By exploring and discussing what a theme is, what a theme engine is, how to enable a theme, and what files make up a theme, Ric allows and the reader, no matter how advanced, to get a good overview of Drupal's theme system in a matter of pages.

Chapter two (Theme setup and configuration) follows on nicely from the last chapter, after the reader has learnt what a theme is and how it works, Ric then works through the process of downloading and installing the Zen theme. The theme configuration is then covered in a lot of detail, aspects such as the color module configuration, page elements, logo and shortcut icon settings. These are all covered from the perspective of a user or a site manager, and not from the perspective of a developer, who would be looking at how to incorporate these features in their theme. This chapter also covers other aspects of configuration that will effect the look of your site such as block and module management, blocks are looked at in slightly more details, covering the configuration of the access levels and visibility of the blocks.

Theme Engines where briefly covered in the first chapter, but Chapter three (Working with theme engines) greatly expands on this. Drupal's default, and most used theme engine, is PHPTemplate, which is where this chapter starts, and what most of the chapter covers. Ric covers the contents of a PHPTemplate theme in a lot of detail, with full code for each of the files within the Bluemarine theme. In a section headed "Alternative theme engines" covering just over two pages Ric discusses PHPTAL, Smarty and PHP XTemplate theme engines.

Now that the reader had a good idea of what a theme is, how to configure it, and run through of the code in an existing PHPTemplate based theme. Chapter 4 (Identifying templates, stylesheets, and themable functions) starts to look at code that the reader may want to use in their theme. The chapter works through most, if not all of the core modules listing all the stylesheets, themable functions and variables that could be used of overridden within your theme. This chapter is a great reference for new and existing theme developers.

Chapter 5 (Intercepts and overrides) starts by simply looking into how to override CSS attributes, but then expands upon the lists within Chapter 4 to explain how to override templates and themeable functions. It looks into what part the template.php file plays within a theme, how to add one and what to do with it. Template.php files can be very complex, but Ric managed to describe the how to do the overrides very well, but quite briefly.

Chapter 6 (Modifying an existing theme) is quite a long chapter but explains the process of making a sub theme from the Zen theme very well with all the code needed. For the more advanced Drupal developer, with little theming know how, this is where the book starts to get exciting, and by the end of the chapter you have your very own sub theme that you could submit back to the Drupal community.

Chapter 7 (Building a new theme) works in very much the same way as chapter 6, but without the Zen theme as a base, so there are few pages on planning your theme and setting up your files. All the code is given, but this can also be downloaded from Packt's web site. By half way through the chapter you will have your own PHPTemplate based theme, but the chapter carries on to look at a pure PHP theme, or one that doesn't use a template engine. Ric uses the Chameleon theme as an example and steps through the development process of a theme such as Chameleon.

Now that you have a Zen sub theme and a custom theme chapter 8 (dynamic theming) moves on to look at ideas such as admin themes, multiple page or section templates, dynamically theming page elements and working with template variables. This chapter is really great for the more advanced developer and expands on some of the ideas discussed earlier in the book. All of the techniques displayed within this chapter will allow the reader to make their theme change depending on the page being viewed, the user viewing it, what regions are being used and other dynamic variables.

Chapter 9 (Dealing with forms), the final chapter, is a very specific module looking into modifying the look of forms in many different Drupal-y ways. Starting by looking at how forms work in Drupal, the chapter moves on to look into modifying forms by using simple approaches such as CSS overrides, theme functions and custom modules.

The appendix includes a Drupal CSS Map, which maps out the CSS files for all core modules, all files for all core themes. Also included is a "Themer's Toolkit" section, looking into useful modules and firefox extensions.

In summary, Drupal 6 Themes by Ric Shreves is a great book for new Drupal theme developers, and the second half of the book provides a great resource for the more advanced developer too. My only complaint with the book is that it would be nice if a few of the screenshots where printed in colour, to give a clearer view.

If this review has inspired you to by the book, please use the link below.
http://www.packtpub.com/drupal-6-themes/book/mid/260309fum7fs