Book review : Drupal 6 Themes

websesame's picture

Book Title : Drupal 6 Themes
Author : Ric Shreves
Publisher : Packt publishing

You must have many times heard it said that you don’t get a second chance to make a first impression. This saying couldn’t have been more accurate for the web. There are millions of websites out there. When a visitor comes to yours whether by invitation or by accident, the first thing they are likely to consider before deciding to tarry awhile or to burn rubber is how the site looks. Is it attractive, and is it user-friendly? If your site doesn’t pass the look test it will quite likely go down as one the sites to avoid in future, in the Book of Death of every visitor and their children’s children even  to the fourth generation.

In Drupal web development framework the look is primarily determined by the theme, which is the “skin” that covers the complicated coding underneath and which makes it fit for human to use. The theme is used to lay out the important elements of the site content in a manner that should make them readily accessible. There are scores of free contributed themes for Drupal available for use, but a discerning web site owner will probably not want a site that looks like several hundred others on the internet. To obtain a theme that will be specifically suitable for the optimum display match of your site content you have two choices – either to buy one or to create one yourself. If you do decide to go for the choice of creating  your own theme , the book  Drupal 6 Themes by Ric Shreves offers a good helping hand .

Drupal 6 Themes explains the principles behind the Drupal theming system and  also provides a reference for theme developers. This the author has done by illustrating key points through demonstrating practical solutions to common problems. The book begins with an overview of the default theming system and how you can squeeze the most out of it. In the middle sections, the author discusses how to execute more extensive modifications by directly working with Drupal's theme functions and styling. In the latter chapters, more advanced topics, like how to make the site's presentation layer responsive to the users or the content and how to build templates from scratch are discussed.

Chapter 1 covers the various types of themes, the basic elements of a theme, and the functions those elements fulfil. It examines the working of the theme system in Drupal, and the different approaches to working with Drupal themes.

There is a  large and active community of developers that has formed around Drupal and which guarantees a steady flow of themes for this popular CMS. The diversity of the Drupal community also assures that there will be a wide variety of themes produced. Add into the mix the existence of a growing number of commercial and open-source web designs, and you can be certain that somewhere out there is a design that is close to what you want. The issue becomes identifying the sources of themes and designs, and determining how much work you want to do yourself. Chapter 2 takes a look at finding, installing, and configuring a pre-existing Drupal themes

Chapter 3 explores theme engines in general and Drupal's default PHPTemplate theme engine in detail . It covers how the PHPTemplate theme engine works and how the theme designer can use this powerful tool.

The output of the Drupal system is subject to formatting via three primary elements: templates, stylesheets, and themable functions. These various elements are scattered throughout the Drupal distribution and may not, at first glance, be obvious. Accordingly, one of the most important keys to the success of your theming efforts is the ability to identify and locate the elements that impact the appearance. In Chapter 4, the reader is taken  on a guided tour of all the system's various templates, stylesheets, and themable functions identifies all the themable elements in the Drupal system and shown where to find the elements together with an explanation of their functions.

Chapter 5 dives quickly into the most powerful technique for customizing the output of a Drupal site—the use of intercepts and overrides. The logical consistency of the Drupal architecture lays the foundation for the approaches discussed in this chapter. Through the application of simple naming conventions, the theme developer  can intercept and override the system's default styling. By creating your own templates and selectors and then naming them properly, it is a relatively easy matter to gain control over the output of the Drupal site.  This chapter cover employing of intercepts and overrides to modify the default styling in your Drupal theme.

The majority of people who set out to master Drupal theming start out by modifying existing themes and learning from the process; In Chapter 6, the reader is shown how to put together the various techniques that have been covered up to this point and demonstrates how to modify and heavily customize an existing theme.
.
While many people may undertake a theme project by copying and then modifying the files of an existing theme, Chapter 7 caters to the purists who want to do it all themselves. The chapter takes the reader into the world of building Drupal themes from scratch. It covers the basics of creating a new theme employing the PHPTemplate engine, and step through the various tasks required to produce a fully functional theme. The chapter also  takes a brief look at creating a pure PHP template, that is, theming Drupal without the use of a theme engine.

The Drupal system, when combined with the PHPTemplate engine, gives you the ability to create logic that will automatically display templates or specific elements in response to the existence of certain conditions. From Chapter 8 the reader should learn how to run multiple templates, and how to  create dynamic elements and styles. Among the techniques covered in this chapter are: using suggestions—naming conventions—to control template display, the use of $body_classes to create dynamic styling, and the implementation of the preprocessor function.

Chapter 9 covers one of the more complex areas in the system - the styling of forms in Drupal,. It looks at the forms generated by the Drupal core and how they can be themed. These include all the default forms available on the front end of a Drupal website, including the various search, login, and contact forms, as well as the polls module. However it is worth noting that this chapter is about theming forms, not about creating custom forms; neither does it discuss adding or deleting form elements It is wholly concerned with presentation of default forms.

Drupal 6 Themes is a very useful book indeed, well – illustrated and easy to follow. The author comes from a design background and therefore many of the explanations and rational reflect the author's background.  Creating a powerful website in Drupal can be something of great pride. Being able to complement  it with a great custom theme makes a lot of difference to discerning users of your website. With a bit of HTML coding knowledge and a good editor you can learn to build quite fantastic Drupal themes  using this book