Drupal 6 Themes
by
Ric Shreeves on
Packt Publishing is a great resource for newbie Drupal themers. Themers who are not from a programming background will find it especially useful since it starts with the basics and builds up to more complex yet powerful techniques such as
hook_form_alter(). Programmers and those who are more experienced with code-editing will most likely find
Pro Drupal Development (
USD 30-50 on Amazon.com
)
a more concise and comprehensive resource (
Pro Drupal Development's chapters 8 and 10 covers much of the same content, although is less detailed and may be difficult for non-programmers to keep up with).
Drupal 6 Themes chapter 9 on
Dealing with forms is especially useful. This is one of the more difficult and less flexible aspects of Drupal theming – nevertheless Ric Shreeves details 5 different techniques and explains the advantages and disadvantages of each. Shreves also includes detail about theme-function names,
*.tpl.php files and
*.css files of specific forms which are often sought by themers, such as the search, contact, user login and user registration forms.
Ric makes several good recommendations throughout the book and encourages good practices by encouraging the technique of sub-theming, encouraging the use of the zen theme as a base theme, discouraging the use of theme engines other than PHPtemplate and discouraging modifications to Drupal core and contributed files and modules. He even goes as far as explaining some of the reasons (those that non-engineers are going to understand best) why core and contrib hacks are problematic.
Another valuable feature of the book is the introduction to the tasks that aren't strictly theming, but usually end up being left for the themer to do – such as setting permissions, creating and configuring menus and blocks and even creating dummy content with
devel's content generator module.
Several relatively minor notes for improvement and 'gotchas' to watch out for are;
- The use of the term 'activated' in lieu of Drupal's 'enabled'.
- The lack of distinction between uses of Firebug and Web Developer extensions for Firefox. These tools are useful and complementary, however the author presents them as alternatives to each other on page 143.
- Although the author discourages editing of core and contrib files, he modifies
themes/garland/template.php in an example on page 137. Don't be fooled – revert your modifications before you move on.
- Page 38 implies a theme must first be enabled before it can be made the default theme. This is not the case. A theme can be made the default theme and enabled in one form-submit.
- Page 147 fails to describe the syntax of comments in Drupal's
*.info files – lines start with a ; semicolon.
- The diagram on page 128 describing how Cascading Style Sheets (CSS) 'cascade', override and take priority, suggests that the order of hierarchy is a tree-like hierarchy, while the order of precedence is in fact linear. A step-by-step walk-through of using Firebug to show how Firefox overrides CSS definitions would be a more effective way of teaching this concept.
- The statement on page 128 The theme's
style.css file has the last word is incorrect. Zen theme and Zen sub-themes almost always have stylesheets that take precedence over the theme's style.css.
- While sub-theming is described elsewhere in the book, it is not included in the section on how Drupal chooses which
*.tpl.php takes precedence in chapter 5.
My most significant criticism would be the lack of detail about critical tools such as
Firebug and
Devel's Theme Developer module.
Chapter 4 dedicates many pages to listing all of Drupal core's
*.tpl.php files, their uses and their variables – including the not useful ones like DB log and System log. A more valuable use of the pages would be to demonstrate how to use
Devel's Theme Developer module to retrieve this information. This approach would also encourage learning by discovery and self-dependency instead of dependency on a book which will be outdated by the time Drupal 7 is released.
Similarly appendix A detailing Drupal core's CSS files and definitions is interesting but not useful. A demonstration of how to use
Firebug to retrieve this information would be a more valuable use of those pages.
The
Devel's Theme Developer,
CCK,
Views,
Panels,
Firebug and
Web Developer are covered in appendix B, but their usefulness is severely under-rated and they only mentioned, not described or demonstrated. Devel's Theme Developer does get a slightly more detailed demonstration in another portion of the book, but this is not referenced from the appendix.
No book is perfect – however even upon taking into account the areas that leave room for improvement,
Drupal 6 Themes rates highly. The most important points, in my opinion, are that the text flows well, is easy to read and that diagrams are useful, meaningful and correct. Many cross-references between sections of the book help the reader find answers even if they are looking in the wrong section. And the book reads well both from top to bottom or inside out – however you like to use it!
Drupal 6 Themes costs USD 40 on Amazon.com,
GBP 25 on Packt Publishing's website and is similarly-priced elsewhere.
Disclaimer
Packt Publishing requested me to review a number of their Drupal books. I agreed to do so in exchange for free copies of the reviewed books. I am receiving no other compensation from Packt Publishing in exchange for these book reviews. See
more reviews of Drupal books.
Comments
Very good review
drupal development
I have heart about this. But i dont know about much.
Thanks.
http://www.inowweb.com