Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Book Review: Drupal 7 Themes

samzenpus posted more than 2 years ago | from the read-all-about-it dept.

Book Reviews 28

Michael J. Ross writes "If you need a theme for a web site based on Drupal 7, then you have a few options for obtaining one. You could go with an existing theme, but the current crop of prebuilt themes is even more limited for Drupal 7 than its predecessor. You could hire a dedicated Drupal themer to create one for you. Or, to avoid the expense, you could try to build your own. In that case, you will need to get up to speed on the changes in the Drupal presentation layer. Unfortunately, most of the Drupal 7 books devote only one or two chapters to the topic. Several Drupal training firms offer video instruction, but the bulk of their material is still geared to version 6, or even 5. The online documentation is of little help. Yet there is a book that is wholly dedicated to the topic: Drupal 7 Themes, authored by Ric Shreves." Read on for the rest of Michael's review.This title was released by Packt Publishing on 24 May 2011, under the ISBN 978-1849512763. This review is based on a print version of the book, kindly provided by the publisher. An e-book version — in both the PDF and Mobipocket formats — is available from the publisher's page. Visitors will also find a book description, the table of contents, a sample chapter (the seventh one, "Dynamic Theming"), and, elsewhere on their site, the reported errata (only one at this time). None of the example code presented in the book appears to be downloadable — probably because there is little of it. Like so many Packt Publishing titles, this one is relatively slender compared to other publishers' Drupal books, at 320 pages. The material is organized into ten chapters, as well as an extensive appendix occupying a quarter of the book. The preface notes that the only requisite knowledge is "basic experience of working with Drupal," as well as HTML, CSS, and, optionally, some basic knowledge of PHP. This book is a revised and expanded edition of his previous book, Drupal 6 Themes.

The first chapter provides an overview of the basic concepts of Drupal theming, including its purpose, its customization capabilities, the intercept/override paradigm, sub-themes, some online resources, theme engines, theming output, front-end versus admin themes, the default Drupal 7 themes, and theme files. It is a decent introduction, but would likely be more helpful to theming newbies if the basic concepts — such as what themes are — were discussed prior to more advanced topics — such as intercepting and overriding. All of the material is clear, except for the reference on page 21 to "the Add Shortcut icon," which is not identified or apparently even present in the referenced screenshot. Chapter 2 covers the basics of the configuration settings for themes (global and specific), blocks, and regions, as well as how to install and uninstall themes. It can be safely skipped by anyone familiar with administering a Drupal site.

PHPTemplate has become the de facto templating engine in Drupal, and is introduced in the third chapter. The author focuses on the key files that compose a Drupal theme, and for illustrative purposes uses two themes built into Drupal 7: Seven and Bartik. The author of the latter, Jen Simmons, a female web designer, is oddly referenced in the masculine (page 80). The subsequent chapter gets off to a poor start with nine paragraphs that essentially state the same thing, over and over. But it eventually delves into the critical topics of default templates, themeable functions, individual styles, and whole stylesheets, as well as how they can be overridden using custom CSS and PHP code, including template preprocessing functions. The theory is later illustrated with a focused examination of Bartik. It is with this material that the author begins digging into the technical details of how custom Drupal theming is accomplished.

Chapter 5, "Customizing an Existing Theme," demonstrates how to create a sub-theme, in order to leverage the functionality of a base theme. Readers may be confused as to why the author chose to not present his list of recommended base themes, until the next chapter. After all, readers presumably would want to know the optimal candidates for starter themes while first learning how to select and use them. This confusion could have been avoided had the author explained that those are not just base themes, but starter themes. More importantly, the narrative contains a technical error: On page 115, readers are told that "This is a requirement for a valid sub-theme; you need at least one stylesheet." Testing shows that assertion to be untrue; only a .info file is required. Four pages later, readers are told to refresh Drupal's cached registry to see changes to the template files and theme functions, which contradicts the tip on page 94 that such refreshes are only needed when theme functions or templates are added or removed, but not if they are changed. Aside from these blemishes, the material presented is more than adequate to help get readers started with sub-theming.

Some readers will likely be disappointed that the first half of Chapter 6 discusses how to build a theme using a base theme — the previous chapter's topic — except instead of Bartik as the base theme, a more basic starter theme, Fusion, is used. Aside from that, it's the same process, and large chunks of the text are duplicated — even the erroneous claim of a stylesheet being required (page 130). Finally, the reader arrives at the second half of the chapter, which explains how to create a new theme from scratch. Other sections of the book are referenced heavily, which is possible because the first five chapters have set the stage for this topic.

With Chapter 7, the author takes the earlier introductions to theme templates, and explores them in much greater detail, showing how to separately theme specific groups of pages, including a site's homepage, as well as regions, blocks, and specific elements on a page. The author states (page 158) that all the theming baseline variables are documented inside of the page.tpl.php file, but that only seems to be true for the Bartik and Zen themes. Also, the concept of a block delta is not adequately explained or illustrated. Otherwise, this chapter provides more content and less repetition than most of the others. It concludes with a discussion of CSS classes dynamically generated by Drupal.

Traditionally, one of the most problematic areas of web design is the styling of forms — the focus of Chapter 8. The forms that are built into Drupal by default — user, search, poll, and administration — are presented from a functional standpoint. It is then shown how they can be modified using half a dozen techniques, with varying levels of control over the output and the amount of complexity in achieving that control. The next chapter looks more broadly at other difficult aspects of Drupal theming — including cross-browser compatibility, accessibility, validation, theming the output of various core modules, and many more topics. Some of the tips provided could be quite valuable if and when the reader is stymied by one such problem or another. The final chapter, "Useful Extensions for Themers," introduces a number of helpful tools, most of which are contributed modules. The book concludes with a lengthy and detailed appendix that lists the files, paths, and descriptions for all of the theming system-wide functions and mostly the core module-specific templates.

The author's writing style is conversational, with generally comprehensible explanations. But there are a few baffling phrases, such as "displayed in courtesy of a conditional statement" (page 70); and the common phrase "you likely need to" is twisted into "you are likely needed to" (page 119), which actually has a different meaning. All sorts of phrases are set in title case, without reason, such as "Dev Server" (page 111). Something else that may be difficult to fathom, is that the book's code does not reflect the fact that Drupal.org transitioned from CVS to Git for version control, in February 2011, three months before publication of Drupal 7 Themes.

There is a fair amount of redundant information, even on the same page — such as the theme settings instructions, in duplicate on page 36, and partly repeated again on the next page. Each chapter concludes with a summary, which in most cases is of no benefit to the reader, given how short most of the chapters are. Far too much of the text is presented in bracketed and indented warnings and tips. For instance, page 180 has no fewer than four such blocks of text, and they take up most of the page. In fact, there are several places where a paragraph of the main narrative is inexplicably turned into a warning, indented with large brackets (e.g., pages 71 and 95).

Punctuation is another area where this book could be improved. Most computer programmers use far too few commas in their writing, but this book demonstrates the opposite problem in several places, such as twice on page 71. On the other hand, there are places where a comma could have made the narrative more clear upon first reading. Fortunately, this problem is not nearly as prevalent as seen in the preface, which appears to have been written by someone whose first language is not English. As with most books written by techies, this one contains too many exclamation marks — invariably an indication that the author is trying to make a dull subject seem more exciting. Fortunately, most of this is limited to the early material, and dissipates as the author settles into the important topics. Lastly, there are many spots where the wrong punctuation symbol is used, e.g., a comma trying to perform the duties of a semicolon.

Seemingly every Packt title contains a long list of errata, and this one is no exception: "focuses is on" (page 2), "you Drupal 7 site" (2), "Identifying" (2), "access to [a] Drupal 7 installation" (3), "Addition[al] tools" (3), "function [of] Drupal themes" (11), "an as" (24; should read "as an"), "Supports [a] four-column area" (24), "all/ themes" (30), "those global setting[s]" (40), "<none>" (49; should read "- None -"), "jump[ ]start" (56), "a temporary CSS files" (87), "in [the] last style sheet" (89), "go ahead [and] make" (100), "Why it is" (113; should read "Why is it"), "functionbartik_menu_tree" and "functionjeanb_menu_tree" (123; similar mistakes are seen on pages 181, 189, and 195), "be name[d]" (124), "cssto" (130), "the advantages" (147), "is it" (151; should read "it is"), and "different appearance[s]" (153). At this point, roughly halfway through the book, I stopped recording errata. Packt Publishing's copyeditors should have spotted and fixed these problems, as well as those scattered throughout the rest of the manuscript.

Yet the major weakness of this book is the extensive repetition of material — ranging from the paragraph level (one paragraph repeating information from earlier, nearby ones) to the chapter level (e.g., Chapter 6's wholesale copy-and-paste of material from the previous chapter). Also, the book would have been more current if it addressed the critical web design topics of responsive design, media queries, and how they can be employed in Drupal theming. But it is possible that constraints of space and available time for this project, prevented the inclusion of these advanced topics.

Aside from these problems, and those mentioned earlier, this book does a fine job of explaining the key concepts, and demonstrating them in sample code. Drupal 7 Themes is possibly the best available resource for anyone who wants to learn how Drupal themes work, and how to build custom themes.

Michael J. Ross is a freelance web developer and writer.

You can purchase Drupal 7 Themes from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

Sorry! There are no comments related to the filter you selected.

Here ! Our monthly drupal pushing article ! (3, Insightful)

unity100 (970058) | more than 2 years ago | (#37849304)

and now since there is nothing to push from drupal core, why not push its themes ?

ehhhhhhhhhhhhhh .

Re:Here ! Our monthly drupal pushing article ! (2)

Jeng (926980) | more than 2 years ago | (#37849350)

Only 21 days since the last Drupal book review.

Holy fart batman ! (0)

unity100 (970058) | more than 2 years ago | (#37849430)

I thought they would at least wait 1 month to be politically correct.

Re:Holy fart batman ! (1)

Jeng (926980) | more than 2 years ago | (#37849522)

It's funnier than that, there has only been one other book review in that time period, so it was almost back to back.

Re:Here ! Our monthly drupal pushing article ! (0)

Anonymous Coward | more than 2 years ago | (#37849454)

Well Drupal is pushing throught enterprises fast, there are lot of demand for skillset and training is propably lacking behind.

And yes, at this point Drupal is cool / hip / pop / rocking platform.

Re:Here ! Our monthly drupal pushing article ! (1)

Anonymous Coward | more than 2 years ago | (#37849576)

Drupal is a shit CMS and Packt is a shit publisher.

Even the drupal logo is a tear of shame and despair, as seen on the faces of the people forced to use it.

-- Ethanol-fueled

Re:Here ! Our monthly drupal pushing article ! (0)

Anonymous Coward | more than 2 years ago | (#37850380)

You probably haven't even tried building a Drupal site or you gave up early. Please tell us a better CMS, with the same community openness and support and that scales as well and work for as many types of sites.

The learning curve for Drupal is higher than other CMS because it's not meant to be a pop-up shop and requires some setup, because everyone's is different.

These books seem to struggle when straddling the fence from beginner to pro. The best way to learn Drupal is to become part of the community, and become very good friends with Google.

Re:Here ! Our monthly drupal pushing article ! (1)

Compaqt (1758360) | more than 2 years ago | (#37851992)

Is there a better one?

It's almost like Churchill's quote about democracy (worst system except all the others).

Basically, if you want a blog, you'll be running WordPress.

If you want general functionality beyond that, Drupal's usually the ticket. It's the power of numbers: if you encounter a problem, somebody else probably did, too, and the answer's on Google.

Re:Here ! Our monthly drupal pushing article ! (0)

Anonymous Coward | more than 2 years ago | (#37853842)

Okay, and your WordPress and html sites are any better?! http://yvettesbridalformal.com/

Re:Here ! Our monthly drupal pushing article ! (1)

Hognoxious (631665) | more than 2 years ago | (#37853270)

Did that one score 7/10 too?

Sores To Sores Transformation: +4, Fun (1)

Anonymous Coward | more than 2 years ago | (#37849436)

Is there a PHP to Brainfuck compiler?

Thanks in advance.

How is this front page? (1)

Anonymous Coward | more than 2 years ago | (#37849446)

Seriously.

Re:How is this front page? (1)

Jeng (926980) | more than 2 years ago | (#37849558)

Because who pays to have their review buried?

Re:How is this front page? (0)

Anonymous Coward | more than 2 years ago | (#37849822)

Not Packt publishing!

What did I win?

Wait that wasn't a rhetorical question? ;-)

Drupal Overload (0)

Anonymous Coward | more than 2 years ago | (#37849546)

What the hell is up with all the Drupal book reviews? You know there are other content management systems out there. Some of us who like sanity might maybe enjoy having some of those books reviewed as well.

Here let me summarize the book for you without reading it: Drupal $whatever has it's problems but can be powerful tool for $something

Re:Drupal Overload (2)

styrotech (136124) | more than 2 years ago | (#37850404)

What the hell is up with all the Drupal book reviews? You know there are other content management systems out there. Some of us who like sanity might maybe enjoy having some of those books reviewed as well.

Here's the shocker...

If nobody cares enough to submit any reviews of books about something_else, then there won't be any reviews of books about something_else.

You can't blame slashdot or the people (cough publishers cough) who actually do submit book reviews for that.

Re:Drupal Overload (1)

cshark (673578) | more than 2 years ago | (#37851798)

Drupal's not too bad.
I like it better than wordpress, for writing add-on apps. I like the fact that it gives you everything you need, and assumes that you'll know how to use it, rather than pandering to gummy interfaces and "ease of use" like that means anything anymore.

Re:Drupal Overload (1)

drinkypoo (153816) | more than 2 years ago | (#37852084)

All you say is true, and if only there were better and more illustrative documentation for learning to use it, I would be even more excited than I already am (I use Drupal and advocate for it when someone is looking for a CMS for a variety of reasons.)

Re:Drupal Overload (1)

cshark (673578) | more than 2 years ago | (#37852474)

When I first started using it, I was impressed at how extensive the video docs are on it.

Certain things have been less than perfect, like figuring out how to make an upload work inside a module; but over all, I like the fact that most of the work I usually need to do before writing a web application is done before I even start. The system let's me focus on those areas of programming that are fun.

Of course, it's a give and take with anything like this.
My only real complaint with Drupal is the memory footprint. Wouldn't be so bad if I had unlimited server resources. That said, for most of my use cases, it's worth it.

Re:Drupal Overload (1)

drinkypoo (153816) | more than 2 years ago | (#37854682)

One of the things I hate most about drupal (after, as you say, the memory use) is that I have to watch videos to figure out how to do anything, because the people who know how to do this stuff are apparently incapable of sitting down and writing a HOWTO [hyperlogos.org] useful as reference material.

informative spong3sponge (-1, Offtopic)

Anonymous Coward | more than 2 years ago | (#37849584)

FreeBSDU wegnt out

Open Documentation for Open Software (3, Interesting)

Mandrel (765308) | more than 2 years ago | (#37849598)

It'd be nice if Open Source software could have good open documentation, which would allow the documentation to be rapidly and easily updated and improved by the community.

GPL shouldn't be used, because that would allow anyone to make available beer-wise-free copies, which would not reward the authors' work. Instead the book's copyright licence should allow anyone to fork it and sell it, as long as they paid the original authors the normal per-copy price, keeping for themselves any premium they could earn due to their improvements.

Why such a good review if it has so many flaws? (1)

Dynedain (141758) | more than 2 years ago | (#37849652)

The author's writing style is conversational, with generally comprehensible explanations. But there are a few baffling phrases... All sorts of phrases are set in title case... Something else that may be difficult to fathom, is that the book's code does not reflect the fact that Drupal.org transitioned from CVS to Git for version control, in February 2011, three months before publication of Drupal 7 Themes. ...

There is a fair amount of redundant information, even on the same page...

Punctuation is another area where this book could be improved. .... which appears to have been written by someone whose first language is not English. As with most books written by techies, this one contains too many exclamation marks — invariably an indication that the author is trying to make a dull subject seem more exciting.... Lastly, there are many spots where the wrong punctuation symbol is used, e.g., a comma trying to perform the duties of a semicolon.

Seemingly every Packt title contains a long list of errata, and this one is no exception: ... At this point, roughly halfway through the book, I stopped recording errata. Packt Publishing's copyeditors should have spotted and fixed these problems, as well as those scattered throughout the rest of the manuscript.

Yet the major weakness of this book is the extensive repetition of material ... e.g., Chapter 6's wholesale copy-and-paste of material from the previous chapter)....

And yet you still gave it a 7/10. There isn't much room for better books in your rating scale now is there?

do77 (-1)

Anonymous Coward | more than 2 years ago | (#37849838)

and Edxecutes a

Useless comments (-1)

Anonymous Coward | more than 2 years ago | (#37851562)

I was excited when I saw this story, not for the book review itself, but to read some opinions and discussion about themes for Drupal. Instead, all I see is off-topic complaining. Can anyone offer some useful personal experience and advice on selecting, modifying, and/or creating themes for Drupal? Perhaps this book and book review are bad, as everyone seems to want to focus on. If so, does anyone have suggestions for alternate resources that might be useful?

Advice on themes (1)

Bozovision (107228) | more than 2 years ago | (#37853776)

As ever, it depends:

Firstly, the landscape is constantly evolving, and some of what I say below reflects the current situation for Drupal 7. It may not be the same in six months time.

You need to decide:
Do you want very clean, targeted HTML and CSS? Or do you want as many options as possible in the CSS, and don't mind the cost of many wrapping divs and CSS with many overrides?

If it's the latter, then you will likely want to work from one of the starter themes, sculpting the CSS and templates to suit your design. Try the Stark (shipped with Drupal 7), Clean, Boron and Basic themes.

Or if it's the former then you will likely want to either build the theme from scratch or work from one of the minimal themes, and build up to cater for your exact requirements. Omega, Zen, Adaptive, Genesis and Fusion are all good bets.

You need to decide whether your design is grid-based or not. If it is grid-based, then it's easier to use a theme with built-in grid support. (Or you can add grid support to a theme which doesn't have it.) If your design is not gridded, then you are probably best-off not using a gridded theme (though of course you could override the grid classes to remove the grid.)

If it's grid-based, then the best is probably Omega, but 960 is worth a look. For non-gridded, Stark, Clean, Basic, Zen, Adaptive, Genesis and Fusion are all still ok.

You need to decide whether mobile support, HTML5, and adaptive theming are critical or not. Of course you can override the templates a theme provides, to include any of these, but starting off with a theme with them built-in will be easier for most people.

If any of these are critical, and you aren't interested in building in support yourself, then Omega, Adaptive, Genesis, Boron and Fusion have support for some or all of these features.

At the moment, if a maximal theme, with grid support is what interests you most, Omega is the best imo. The cost is that it's big, and complex.

There are several good resources:
http://drupal.org/node/323993 [drupal.org] contains a list of starter themes.
http://www.chapterthree.com/blog/squiggy_rubio/review_drupal_6_starter_themes [chapterthree.com] - is about Drupal 6, but much of it remains relevant for Drupal 7.
And in some blatant promotion, sometime in the next week we'll post an article at http://www.tanasity.com/ [tanasity.com] comparing and contrasting the best starter themes for Drupal 7, the work on which this note is based.

Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?