Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Image

Front End Drupal 68

Michael J. Ross writes "Content management systems (CMSs) are created largely by Web developers using back-end programming languages (such as PHP, by far the most common choice). The free CMSs are built as open source projects, by volunteers who have many demands on their time. As a result of both of these competing factors, far less time is devoted to the front-end aspects of these CMSs. In turn, the "themes" that define the appearance of a CMS-based website are typically substandard, in the eyes of many Web designers and, most likely, countless users of those sites. This criticism has been leveled even against Drupal, although the situation is improving. A new book, Front End Drupal: Designing, Theming, Scripting, is intended to help Drupal designers everywhere speed up that process of improvement." Read on for the rest of Michael's review.
Front End Drupal: Designing, Theming, Scripting
author Emma Jane Hogbin and Konstantin Kafer
pages 456
publisher Prentice Hall
rating 8/10
reviewer Michael J. Ross
ISBN 978-0137136698
summary A comprehensive guide to creating Drupal themes.
The book was written by Emma Jane Hogbin and Konstantin Käfer, and published by Prentice Hall on 15 April 2009, under the ISBN 978-0137136698. As suggested by its title, Front End Drupal "is designed to help both experienced designers and rank novices get an understanding of how Drupal theming works," to quote from the book's foreword, written by Dries Buytaert, Drupal's founder and project lead. He notes that creating a Drupal theme requires knowledge of "XHTML, CSS, JavaScript, and PHP, all within the context of Drupal." These are some of the key technologies addressed in the book's eleven chapters, and it assumes that the reader is at least familiar with all four of them. The first of the two appendices explains: how to install Drupal and contributed modules on the three different platforms supported (Windows, Linux, and Mac OS X); basic configuration and administration; and installation troubleshooting tips. The second appendix comprises some of the more important example code used in the book, and brief overviews thereof. At the end of the book's 456 pages, there is a coupon code for a 45-day free subscription to read the online edition in the Safari Books Online library

All of the sample source code and themes can be downloaded from the authors' book website. The site also has the author biographies, as well as reported errata, of which there are two, as of this writing. What is most striking about the site is its styling — or lack thereof. One would think that the authors of a book on Drupal theming would have put a commensurate amount of effort into crafting an attractive custom theme for their own website — one that demonstrates their own theming skills and, more importantly to the reader, what is possible using the principles taught in the book. Remarkably, the authors appear to have done nothing more than take the Drupal 6 default theme, Garland, and change the color scheme from shades of blue to shades of brown (matching the book cover); only the blue Drupal icon is unchanged, and its color clashes with the rest of the site.

Prentice Hall makes available their own Web page for the book, where visitors will find a description, two Amazon.com reviews, the table of contents, and a sample chapter ("The Drupal Page") as a PDF file. The entire book is also available in electronic form.

In the book's preface, the authors briefly summarize the chapters and appendices, and define the target audience and technologies with which the reader should be knowledgeable (noted above). Readers should also be familiar with how Drupal works, have some experience administering a Drupal site, and ideally possess some knowledge of website design and development; but that last one is not a hard requirement, since the authors promise to explain the basic concepts as needed.

Any reader who begins the book by skimming the table of contents or the preface's summary of Chapter 1, may be tempted to skip that chapter, especially since it discusses team workflow — something freelancers generally ignore, and employees leave to management. Yet the earlier material is worth reading, if only that it begins to establish a baseline of terminology used throughout the rest of the book. It also provides some basic information on content structure, layout, and naming on a Drupal page. For illustrating the ideas under discussion, the authors use a number of existing websites. In fact, too many different sites: Readers probably would have found it more useful for each idea to be presented in the context of a single neutral subject area, and without distractions such as toilet birthdays (no kidding). Even better, the ideas could have been illustrated through example pages — each page illustrating one or several ideas — built from the ground up. By focusing on pages that a reader could quickly create on his own, the authors could have eliminated the screenshots of those various websites. One example is Figure 1.1, which combines two images, with the topmost one largely obscuring the one below. Most of the topics are covered at a very high level — possibly higher in some cases than readers will find valuable. Nonetheless, there is much solid advice, including some recommended theme resources later in the chapter. In the earlier section on "Topical Organization," there is a brief but excellent discussion on the relative merits of limited versus unlimited tag vocabularies.

The second chapter continues to lay the groundwork, by introducing basic Drupal theme strategies and terminology, three major modules that veteran Drupal developers use frequently (CCK, Views, and Devel), and some valuable browser-based development tools. The definitions of Drupal terms are useful — especially for newbies confused by the Drupal handbooks. One exception is the authors' alternative metaphor for "weight," which proves more confusing than the original. Readers then begin learning how to use the aforesaid modules and tools. However, several of the authors' statements are misleading: On page 43, they are instructed to install the CCK module, and then given a list of additional modules needed; the first one on the list is... CCK. On the next page, the authors state that the FileField module requires the Token module, but it apparently does not. On the page after that, the "manage fields" link is given as the "add field" link. Those last two discrepancies suggest that the book is based on outdated versions of Drupal and/or the contributed modules under discussion, even though its publication date is just a few weeks prior to this writing. Any version differences are likely impossible to confirm, since the authors fail to mention which versions they are using, or provide any guidance to the reader as to which versions to use — unusual for a programming book. At the beginning of the chapter, the reader is told he "will learn step-by-step how to create a mini portfolio Web site," but the process peters out not long after a new content type is created, and the reader finishes the chapter with no such portfolio site.

Chapters 3 and 4 move the reader one step closer toward the ultimate goal of being able to create a new theme with confidence. The first one explains how to find, install, and configure prebuilt themes — also, how to create a very basic theme from scratch, and a subtheme using the Zen starter theme. This material comprises a generally thorough introduction to the topics, compared to most documentation, with plenty of step-by-step explanation. An exception is the Zen section, in which the reader is instructed to place the directory into the themes folder; but it is not made clear whether this is the primary Drupal themes folder, or sites/all/themes (as advised several pages earlier). Secondly, in step 3, readers can only guess as to what is meant by "the main CSS file," as there are several. On the next page, the authors mention "configure" links next to the Zen and Zen Classic themes, but no such links exist for those starter themes. The fourth chapter discusses page template files, site-wide variables, menus and navigation, regions and blocks, search results, templating different sections of a site, aliased URLs, taxonomy templates, and styling for output to printers, PDF files, and mobile devices.

The fifth chapter explores the details of how to modify existing node templates, or create new ones, for all content types. This is what makes it possible to develop highly customized page content, including summaries, embedded images, image galleries, and content based upon output from the Views module. The subsequent chapter focuses on one of the most problematic types of content — forms — and how they can be created using the CCK. The authors recommend TinyMCE as one's WYSIWYG editor module, but that has apparently been replaced by the Wysiwyg API. User editing of content is a key element in building an online community using a Drupal-based site, and it is the topic of Chapter 7, which discusses user profiles, permissions, access, comments, blogs, forums, wikis, spam, CAPTCHAs, and how to make content private for members only. The next chapter addresses the theming of the administrative interface, which the typical site user will never see, but can have a significant impact upon the productivity of the developers and maintainers of a site. Readers learn about RootCandy (a refreshingly different admin theme), and how to theme error pages.

The final three chapters focus on JavaScript and jQuery. Consequently, they compose a stand-alone resource of their own, and could even have been used as the basis for a separate book. Chapter 9 provides an overview of the language, while the other two chapters cover jQuery and how it can be used as part of a Drupal-based site.

Scattered throughout the manuscript are tips, each indicated with a pencil tip icon. These help to break up the text visually, and provide valuable guidance. The contrast between the black text and the dark gray background could certainly be improved; but most of the tips are fairly short, so this does not pose a major problem.

Every chapter ends with a summary, and not a single one of them is useful or needed. Any unique information conveyed in them should have been merged with the introductory paragraphs for the respective chapters, which is where readers would be looking anyway to see what each chapter addresses.

The book has numerous minor problems, including grammatical and stylistic errors, such as dashes incorrectly performing the duty of semicolons, some URLs missing the root directory slash, and excessive use of exclamation marks (more than a dozen before even reaching the second chapter). When stating the sequence of menu items to choose in order to reach a particular admin page, the authors should use ">" or ">>" to separate the menu choices, as is done in most computer books. Instead, the authors opted to use commas, which of course turns every sequential menu path into a list of menu items, which is nonstandard and disconcerting. As is typical in a first edition, the book contains several errata: "Partnership" in Figure 1.7 (page 10), "the GiMP" (page 14; should simply read "GIMP"; after all, this isn't Pulp Fiction), "only focus only" (page 26), "Modification / Date" in Figure 2.1 (page 37; should read "Modification date"), "Content Creation Kit" (throughout the book; should read "Content Construction Kit"), "of [the] view" (page 56), "http:jigsaw" (page 66), "INSTALL [is] present" (page 79), "of [a] page" (page 100), and "to to" (page 125) — in the first quarter of the book alone.

A lingering disappointment is that some of the promised examples are not finished in the narrative, such as the portfolio site mentioned earlier. Secondly, the downloadable source code is incomplete, apparently missing the example code in the first few chapters, such as the Bolg theme files. Furthermore, the downloadable code is not organized by chapter, making it difficult to even determine what example code is missing.

On the other hand, the book has much to offer. For the most part, the explanations and step-by-step instructions are clear, and the diagrams and screenshots are all neatly presented and helpful — though some sections of the book could have benefited from more such figures. With its extensive coverage of all the key technologies, and its wealth of valuable tips, Front End Drupal is an essential resource for learning how to create Drupal themes, and fills a long-standing gap in the Drupal literature, better than any other book currently available.

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

You can purchase Front End Drupal: Designing, Theming, Scripting from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

*

This discussion has been archived. No new comments can be posted.

Front End Drupal

Comments Filter:
  • Tired of crappy CMS' (Score:4, Interesting)

    by Anonymous Coward on Monday May 18, 2009 @02:57PM (#28001171)

    I'm so tired of taking over sites where the former "developer" used a Drupal or Joomla installation.

    It is inevitable that the requirements of a custom web app will eventually exceed the capability of these systems. Knowledge of a particular CMS does not a developer make! These are tools in a toolbox and should be used as such. I hate it when people sell themselves as freelance "programmers", but really they only know how to use a particular CMS. So lets write a book and encourage this behavior - bluagh..

    --that's my 2 cents, but then again, I'm just an anonymous coward :-)

  • by haeger ( 85819 ) on Monday May 18, 2009 @03:12PM (#28001427)

    Looking for answers or reporting bugs is somewhat unsatisfying in drupal. To be honest not really drupal but the modules but since they're actually what makes sites useful. Bugs and supportrequests go unanswered for months unfortunatly.
    I love drupal and use it for my own site but finding support is quite hard. Usually it means going into irc and bothering people there which is a bit sad since most answers aren't searchable later. Yes I do try to add the answers I get to drupal.org in case you were wondering.

    Ok, so this wasn't exactly on topic but hey, not many drupal stories show up on slashdot so I thought I'd grab the chance to whine a little.

  • CMSes and my opinion (Score:5, Interesting)

    by Vamman ( 1156411 ) on Monday May 18, 2009 @04:46PM (#28002779)
    Let me take a step backwards for a second and explain my situation. I've been developing for the web for many years now and I've seen technology come and go but I've never seen an idea of an OpenSource web portal take such a strong hold as Joomla! has. PHPNuke was close but even then you rarely randomly stumbled upon a Nuke site every second search. However, unlike Nuke, Joomla seems to have taken over like a bad storm.

    I still have some websites lingering around that use Joomla but I am very much dissociated with that CMS, infact any CMS nowadays. I find the issues that these systems bring to the table far outweigh any little added productivity that a small group can sustain. There are teams of script kiddies from Asia and elsewhere scouring online websites for these systems to prove just how easy they are to hack into. If you have an online database with confidential client information, you are in trouble.

    The largest website I manage is my own and it ran Joomla for 2 years while I was working on my MSc degree. I had to deal with repeated attempts by hackers to break into this website. It was very frustrating after scouring logs on my linux server to find out that they came in through one of the "secured" CMSs. SQL injections, cross site scripting hacks, upload/media vulnerabilities, you pretty much name it that so called secure web server had one big gaping hole in it and that was Joomla.

    I peruse Joomlancers sometimes when looking for some spare cash (freelancing site dedicated to Joomla) and try to encourage local North American companies to ditch this disaster of a CMS. Not only do you have to deal with bugs and exploits at the core but when people load up this CMS with extensions that are mostly all crap (even Community Builder can't seem to get it right) you put together a nice looking template (like this guy with his book from Drupal suggests) and then put it out there for the "Mad Dogs of Vietnam" to hack into and make your online reputation look like shit.

    I salute the chap that pointed out how vastly the Joomla community is growing with its extensions and micro-economic community, its a good point really. But if you take a look at whose running these communities (Joomla Art, a popular Joomla template company, Joomlancers, and others) are all owned by a Vietnam company that has less than stellar ethics when dealing with clients - Just search the Joomla forums. I have to wonder why the top contributors and hackers are all from the same city Hai Noi =) Birds of a feather I suppose or is that just job "security"?

    I got out as fast as I got into looking after websites running Joomla. Last year we had 13 clients running Joomla and what a headache I developed looking after these sites. The previous freelancers knew how to use a CMS and after that they knew nothing. Even their half-assed attempts at building in additional functionality was more of a joke than anything. I had clients breathing down my neck over issues that were really out of my control. One day I woke up and realized that the real issue was Joomla and thats when I drew the line with it. Now a days I only work for clients that will develop from the ground up. I no longer have to deal with the types of security issues that these open CMS systems bring to the table. They are great to impress a client in a hurry with something that looks and works right away but as the days turn into months you will have the gut feeling like "what did I do..." ...don't do it. Build yourself a core set of functions and your own library in PHP and then build ontop of that individual sites. Code Ignitor among others still get a thumbs up from me. Don't use the same mysql fields all the time. Change your database connection strings up. Change critical global variables every now and then. Thats my 2 cents.
  • by timothyf ( 615594 ) on Monday May 18, 2009 @04:55PM (#28002969) Homepage

    I won't comment on the ORM, Views and CCK stuff beyond agreeing that it could be a lot better (though what we have now is much better than where we were). I'm not sure what would constitute solid deployment procedures for you, so without an example I can't comment.

    4) Using native PHP as the templating language. This causes more headaches than one you can possibly believe. A proper templating language should be used instead which will prevent lazy or incompetant developers from adding business logic into templates.

    I can't say that I agree with you on that--most of the template engines I've seen end up replicating a high percentage of core PHP--but in any case, it's a problem that has been fixed already by theme engines. Don't like phptemplate? Use Smarty: http://drupal.org/project/smarty [drupal.org] or develop your own theme engine.

    5) An army of incompetant, unexperienced developers contributing sub-par modules.

    I would say that's not so much the problem as that there isn't a good way to separate the wheat from the chaff currently, though it sounds like that's in the works for the next iteration of drupal.org.

    6) Lack of any kind of namespacing whatsoever. "De-Facto Namespacing" is a pile of shit.

    Heh. Agreed, though I think that this is somewhat a function of the lack of namespacing in PHP influencing the design.

  • by yareckon ( 1236270 ) on Monday May 18, 2009 @06:17PM (#28004017)

    I disagree about the importance of many of your points in the grand scheme of things (when considered against the benefits of a very capable core platform with literally thousands of plugins).

    However, some of what you say is important, is widely acknowledged, and is being actively worked on. Deployment and change management for content and configurations in particular has been a weak point of drupal to this point, but there are now several major projects underway that attack this from different angles. I think the tools will get dramatically better in the next year if the presentations at drupalcon DC 2009 were any indication.

    Also, I think your overall approach to web development is way over on the cathedral side (which may be because of your focus on the needs of large projects, granted). Drupal's community ecosystem flourishes on building on other folks's work. The hook system, allowing modules to exchange events and pass control back and forth, performs the same function in code. It's a very bazaar model once you get out into the contrib repository. You will need to wade into the community to get the most out of drupal, IMHO.

With your bare hands?!?

Working...