Beta

Slashdot: News for Nerds

×

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!

Drupal 5 Themes

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

65

Michael J. Ross writes "For any Web site based upon Drupal, an increasingly popular CMS, the styling of the site is controlled by whatever Drupal "theme" has been installed, enabled, and chosen, by the site administrator. Out of the box, Drupal offers only a handful of themes, and thus site administrators oftentimes will instead opt for a theme developed by a third-party. However, if the administrator cannot find one that exactly matches their needs or those of their client, then they will either have to pay someone to custom-build a theme, or learn how to do it themselves. Fortunately, creating a new theme or modifying an existing one, is not that difficult, as demonstrated in Drupal 5 Themes, by Ric Shreves." Read below for the rest of Michael's review.The book was published on 22 December 2007, by Packt Publishing, under the ISBNs 1847191827 and 978-1847191823. It is a slender volume, at only 260 pages, and yet covers most of the basics, in eight chapters and one appendix: the basic elements of a Drupal theme, including the files involved; finding, installing, configuring, managing, and uninstalling themes; theme engines, with a focus upon the most commonly used one, PHPTemplate; style sheets and themeable functions; overriding CSS rules, Drupal functions, and template files; modifying an existing theme, using the popular Zen theme as an example; creating a new PHPTemplate-based theme from scratch, and how to extend it; creating a theme not based upon an engine; theming Drupal forms. On the book's Web page, visitors can download most of the sample code presented in the book, send the publisher feedback, ask the publisher a question, and download a sample chapter (number 3, "Working with Theme Engines") as a PDF file.

On the positive side of the ledger, Drupal 5 Themes is a solid introduction to Drupal theming, and the author takes his time in explaining the key concepts. Extensive use is made of sample code, in addition to screenshots of themed pages, admin pages, directory trees, and more.

On the negative side of the ledger, the book contains many small errors — even for a first edition. There are far too many misspellings: "new-comer" (page 8), "where ever" (page 10), "blocks manager" (on the same page — even the same paragraph!), "in depth" (as an adjective, on pages 23 and 24), "jump start," "down side" (both on page 27), "sites" (as a possessive, page 54), "some where" (page 87), and one that undermines the technical credibility of the author, "FavIcon" (page 50). Sadly, there are numerous other errata. For instance, on page 47, we stumble over "to the tailoring an existing theme." On page 10, "assemble to core" should instead read "assemble the core." In several instances, "comprise" is mistaken for "compose." The alert reader will spot other signs of sloppy editing: One pages 18-19, the author should have chosen either "Tables Free" or "CSS-based," and be consistent. The penultimate paragraph on page 123 has double periods. The synonym of "theme" that is posited, "template," is related, but not synonymous; but the common term "skin" isn't even mentioned. On page 188, "page-blog-tpl.php" contains a typo.

Some of the author's phrasing is quite awkward, e.g., "Dev Server" (page 120) apparently means a local Web server. In fact, throughout the book he flip-flops on using lowercase or title case for such terms as "block" and "region." The overuse of title case is also found throughout the book, with some of it almost laughable, e.g., "... the Big Picture." In terms of the writing style, it could certainly be improved, such as judicious use of commas where needed — particularly in the countless run-on sentences. In general, this book contains more errata and style gaffes than any other computer book I have ever seen, on an absolute basis — even worse per page, considering it has perhaps half the number of pages of the typical computer book.

Turning to the technical material itself, there are inconsistencies as well. For instance, some URLs contain root directory slashes, while others do not. Some menu breadcrumbs use ">" as a delimiter, while others use "|." Furthermore, the Drupal menu breadcrumbs (e.g., "administer>themes") should be in sentence case, not lowercase, to match Drupal's names. Fortunately, none of the aforementioned flaws prevent the reader from understanding the book's material, but they reveal insufficient effort in the writing and editing phases, and suggest that other, less obvious, mistakes were possibly made.

In terms of the book's production, it could be improved. Some of the images are highly pixelated — especially the screenshots of directory trees. What will perhaps be most annoying to some readers, is the publisher's use of a glossy black ink that causes each page to reflect one's reading light. One might initially hope that this is an unavoidable disadvantage of the publisher perhaps choosing an environmentally friendly ink, or some similar reason, but nowhere in the book is the type or choice of ink mentioned. This suggests the poor choice was made for economic and not ecologic reasons.

The chapter summaries add nothing to the discussion, and could be removed without loss.

We now turn to specific chapters. In Chapter 2, the author discusses how to install and configure themes, and also touches upon global configuration settings, as well as module and block management. This information is put to use in the second part of the chapter, which covers the customization of Garland, the default Drupal theme. Some of the material in this chapter could prove puzzling or even misleading to many readers. The author states that enabling a theme and setting it as the default, applies it to "both front end and back end of the site" (page 31). Actually, it only changes the front-end theme; the back-end theme is set via Administer > Site configuration > Administration theme; oddly, he actually acknowledges this much later. In the theme configuration screenshots in Chapter 2, the "gagarin" theme is missing, even though it was supposedly installed earlier. On page 40, the author instructs, "To access all the user permissions and configuration screens in one place, view your administrator console by module." But Administer > Site building > Modules is not where the administrator sets user permissions and blog configurations. In the discussion of page specific visibility settings, the third radio button option (entering PHP code to control the visibility of the block) is only displayed if the user has enabled "use PHP for block visibility" in Administer > User management > Access control. The figure caption on page 50 could give a reader the mistaken idea that Drupal renames the custom logo image to "garland_logo.gif" automatically, prior to the configuration settings being saved, which is mentioned afterwards. On page 58, the illustration shows PHP code that appears to contain an extraneous tag, , which is probably a holdover from the illustration on page 56; in fact, it breaks the code, because the presence of that string always effectively returns TRUE. On pages 86 and 87, the PHP code contains four back ticks, which should be replaced with straight apostrophes.

Theme engines, specifically PHPTemplate, is explored in Chapter 3. The author explains the primary functionality of the six files that constitute this built-in theme engine. These are illustrated by comparing two PHPTemplate themes — Garland versus Gagarin. The chapter concludes with brief overviews of three other theme engines, PHPTAL, Smarty, and PHP XTemplate.

Modifying a theme to customize a Drupal site, can be done in one of two ways, or a combination of the two, which is the typical approach: overriding default CSS rules, and overriding themeable functions. Chapters 4 and 5 explain how to do so, with the former containing a list of themeable functions organized by functionality. Chapter 5 covers the details of overriding Drupal CSS and functions, including a valuable discussion of the various options open to the developer for overriding functions, including step-by-step instructions. The chapter concludes with a brief explanation as to how to intercept template files.

Chapters 6 and 7 form the heart of the book, because they explain the details of modifying an existing theme and building a new one from scratch. Anyone interested in learning how to style their Drupal-based Web site with maximum flexibility, will find these two chapters of value. However, there are several pitfalls the reader will want to watch for: Early in Chapter 6, the author instructs the reader who is following along to rename the theme-specific functions in the template.php file from "zen_" to "tao_." Yet this is insufficient, because the page formatting for this new theme, tao, already differs from Zen's. This is likely due to the theme PHP files not finding one or more CSS files that still contain the name "zen." In fact, to completely replace the old theme name throughout Zen's code, one needs to change nine other PHP files. In the section describing how to set up the menus, the weights for the "Home" and "Contact Us" links are supposedly set to 10 and -10, respectively, which would place the former to the left of the latter; yet the illustration on page 148 shows the opposite. The "Blog Entries" weight should be -10 instead of 10. The weights for the footer navigation menu links appear to be equally messed up. In addition, both instances of "yourdomain" is followed by an erroneous space. Frankly, it is as if the book had never been technically edited.

Chapter 7, the longest in the book, is possibly the one that will receive the most study by readers who wish to learn the intricacies of making their own theme from the ground up. The author provides a step-by-step explanation as to what is involved in creating a new theme, and the advantages and disadvantages to alternative approaches. He uses a sample theme, "Bluewater," to illustrate the ideas. The problems with this material are fairly minor: The diagram caption on page 152 states that the elements within the CSS are ordered alphabetically, and yet no alphabetical ordering is apparent. In fact, the ordering doesn't even match that in the page.tpl.php file. In addition, page.tpl.php contains a couple curly quotes, though this does not affect its functionality. Aside from these issues, the discussion is quite thorough, and the reader ends up with a fully functional — though not especially attractive — Drupal theme. The chapter concludes with coverage of template variables, the use of multiple templates, dynamic theming, and developing a theme without the use of any theme engine. However, on page 188, the author states where you can find an example page but there's almost nothing on that page — as of this writing — aside from links to pornographic photos and video. Did the author intend for readers to find them? Either way, it signifies poor judgment on the part of the author.

For many PHP developers, working with form pages is oftentimes the most problematic part of creating a Web site. Fortunately, this book tackles the topic, in Chapter 8, as it pertains to Drupal sites.

In spite of the terribly sloppy writing and editing (both narrative and technical), Drupal developers interested in creating their own themes, or modifying those created by other developers, will find straightforward and detailed coverage in Drupal 5 Themes.

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

You can purchase Drupal 5 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.

cancel ×

65 comments

I for one... (0, Offtopic)

Mandovert (1140887) | more than 6 years ago | (#22323942)

...want Duke Nukem Forever news back on main page!

Ugh. (1)

snarfies (115214) | more than 6 years ago | (#22324044)

If Drupal requires a 260 page book to make a theme, their theme system is TOO COMPLICATED.

I used to use Postnuke for one of my sites. I designed my own theme for it, and it was pretty nice - you can see a PARTIALLY saved version of it here [archive.org] . I figured out how to make it by looking at the code for existing themes, which was not too dissimilar to standard HTML, and hacked around with it. In version .750 they switched to a new theme system called Xandria, breaking my old theme. I never managed to convert it to Xandria, because I find the Xandria language to be incomprehensible. The documentation, what little of it there was, was equally incomprehensible, and there were no (working) conversion tools.

So I simply stopped using Postnuke.

Re:Ugh. (0)

Anonymous Coward | more than 6 years ago | (#22324204)

260 pages isn't that much nowadays. Setting up your enviroment, some propaganda about who should use this book, changes between Drupal 4 and 5, debugging, etc.. so yeah, you could just as well hack an existing theme to suit your needs, or you could read this and make it right way. It's not that complicated, but it's always good to follow some guide lines.

Re:Ugh. (1)

aitala (111068) | more than 6 years ago | (#22324384)

Actually its called Xanthia, but yah, it is not the greatest system in the world.

I am moving from Post-Nuke to Drupal because Drupal is looking much better in terms of support, modules, and future plans.

Post-Nuke had been planning its .8 release for years.. well it seems that way to me..

Eric

Re:Ugh. (2, Insightful)

CastrTroy (595695) | more than 6 years ago | (#22324452)

I'm wondering why one would need a theme at all. Just edit the style sheets. If you look at what the people from CSS Zen Garden [csszengarden.com] do with just CSS changes, you'll wonder why you would ever need to change the HTML to create a new theme.

Re:Ugh. (4, Insightful)

yelvington (8169) | more than 6 years ago | (#22324700)

I'm wondering why one would need a theme at all.


I'm wondering if you've ever done anything complex enough to require additional regions not provided in off-the-shelf themes or alternative layouts for multiple content types, or rearrangement of fields in complex content types or user profiles, or overriding microcomponents such as taxonomy links.

Theming is not limited to simple reskinning. CSS is a tool. It shouldn't be your only tool.

Re:Ugh. (3, Insightful)

mdavids (143296) | more than 6 years ago | (#22326432)

... which is exactly the thinking behind the Zen theme [drupal.org] , which was in contention for being the default Drupal theme at the time Drupal 5 was being developed.

Having used a stripped down version of Zen as my starting point for all my themes since Drupal 5 came out over a year ago, I can say that things never work out that simply on any non-trivial site. You always end up hacking HTML somewhere. On refection I think the price you pay for all the crufty wrapper divs needed to provide you with hooks for (almost, but never entirely) every CSS selector you might reasonably want in a theme is just too high. If Firebug is an absolute necessity for understanding your own markup, then you're doing something wrong.

In Drupal 6, customising HTML output will become a lot easier for non-programmers, as a lot of stuff that previously required a PHP theme function to override, can now be overriden by template files in your theme directory.

Re:Ugh. (0)

Anonymous Coward | more than 6 years ago | (#22328056)

Not having to play about with php to get the html I want is exactly why I settled on typo3 with the templavoila extension.

Re:Ugh. (2, Insightful)

passthecrackpipe (598773) | more than 6 years ago | (#22331266)

Obviously a good decision when general looks are more important then robust management of content. To base you decision on the CMS you use on the basis of the easy themability of your framework, as opposed to the core way it manages your content says a lot about the value and complexity of your content set.

Re:Ugh. (2, Informative)

ceejayoz (567949) | more than 6 years ago | (#22324470)

The instructions for the most basic methods of theme making for Drupal could be fit in a page. It's sufficient for a lot of people.

Drupal's powerful enough, though, to allow all sorts of neat tricks - different node templates for different content types, overriding any of Drupal's hundreds of theme_xxx functions, etc. It's really a phenomenal system for creating your own customised CMS.

Re:Ugh. (3, Informative)

caramelcarrot (778148) | more than 6 years ago | (#22324486)

Having themed in Drupal it's definitely not too complex, I was able to piece together what I needed to do from samples around the internet, and a lot of it is quite intuitive.

Re:Ugh. (2, Informative)

Firehed (942385) | more than 6 years ago | (#22324620)

It really depends on how technical you are, and if you have any skill in reverse-engineering existing themes. I can't speak for Drupal, but my Wordpress theme-building experience involves looking up functions in existing themes (show the body of the post, date of post, blogroll, "meta" links, etc) and then dropping them in my own content. Often times, it means digging through the seven or eight different levels of functions to find out what argument I actually need to get the output I want, since apparently it's best practice to have show_date() call date_of_post(date) which calls post_date(post, date), which calls... you get the idea (no idea if those are the actual functions, but it goes to show how messy the frequently used function calls are).

I can do it easily enough without buying a tome on the subject, it just requires a bit of digging. There's probably documentation on it somewhere. This kind of book wouldn't be appropriate for me, or people like me who will just rip apart existing code to find what they need. Truth be told, reverse-engineering a template shouldn't be nearly as complicated as that, but having a book as reference material wouldn't hurt. That said, it's the kind of thing that you should be able to consolidate into a couple-page quick reference card.

Re:Ugh. (2, Insightful)

risk one (1013529) | more than 6 years ago | (#22324888)

You know that people have written 260 page books on using Google, right? People write big books about simple things. Drupal's theme system is rapidly converging on that sweet spot of being as simple as possible, but no simpler. If you know how to make a static website from valid xhtml and CSS, you can pick up the zen theme and start filling in the blanks.

It's actually easier than writing CSS from scratch, because the major hassles (how do I do three column layout again? Why is ie rendering it like that?) have been taken care of. Best practices that you didn't know about have been taken into account. Then you get to the little things that every website needs; tiny tweaks in the html output, some added javascript, some extra functionality, and nearly everything I've needed so far is in the API.

Having a really simple theming system is nice to get started, but when I need some to tweak something that the API doesn't expose, that means I need to start hacking the core, which means I need to redo the theme for every update (ie. every vulnerability that's found) and I'm married to the code for the rest of my life. I'd rather spend two more days learning a slightly more complicated system.

Re:Ugh. (2, Informative)

remmelt (837671) | more than 6 years ago | (#22326312)

Drupal can be themed on differents levels. From easy to hard:
- some themes come with settings that can change colours in the admin backend
- CSS level (download a theme or use the default, change around some CSS, done)
- edit or create template pages, which use standard php
- use a different template system such as smarty
- edit or create theme_xxx() functions

Especially if the book covers the creation of theme_ functions and their proper use, I can understand they use 260 pages to explain.

Drupal has its weaknesses, but the theming is pretty solid.

Re:Ugh. (1)

background image (1001510) | more than 6 years ago | (#22326948)

Drupal theming is still pretty hokey in a lot of ways (for example, the whole way it deals with external CSS files is very poorly thought-out), but this:

I used to use Postnuke for one of my sites. I designed my own theme for it, and it was pretty nice

...strains my credibility :-) I've customized themes for most of the bigger open source CMS packages, and Postnuke was one of the very, very worst. Simply no flexibility at all--and this was during the .7xx phase.

In terms of relative simplicity, Drupal theming is to Postnuke theming as plugging a 9 volt battery into a portable radio is to building a nuclear power plant...and even though it's much simpler, you wind up with a far better result.

Spending a paragraph being a grammar nazi ... (4, Funny)

trolltalk.com (1108067) | more than 6 years ago | (#22324098)

... and then writes this:

both instances of "yourdomain" is followed by an erroneous space. Frankly, it is as if the book had never been technically edited.

Re:Spending a paragraph being a grammar nazi ... (1)

Toonol (1057698) | more than 6 years ago | (#22325508)

...both instances of "yourdomain" is followed by an erroneous space.

The "is" is incorrect, but the "an" is fine. Am I missing something?

Re:Spending a paragraph being a grammar nazi ... (1)

trolltalk.com (1108067) | more than 6 years ago | (#22327696)

...both instances of "yourdomain" is followed by an erroneous space.
The "is" is incorrect, but the "an" is fine. Am I missing something?
Yes - you are missing something. Once you replace "is" with "are", the "an" is extraneous. So, for that matter, is "erroneous"

"... both instances of "yourdomain" are followed by space"

You already know the author is citing this as a mistake - no need to be overly repetitive unless you're getting paid by the word.

Re:Spending a paragraph being a grammar nazi ... (1)

Raenex (947668) | more than 6 years ago | (#22338918)

followed by space
Outer space? "a space" is correct, since you can have things like "two spaces", which makes "an" correct in the way it was used. The "is" vs "are" has nothing to do with it.

Re:Spending a paragraph being a grammar nazi ... (1)

Bogtha (906264) | more than 6 years ago | (#22325538)

Speaking of technical editing, why is it so common to see crap like yourdomain in books? The .example TLD along with example.com etc. have all been reserved for this purpose by RFC 2606 [ietf.org] so examples don't conflict with domains that are already in use. Isn't this the sort of thing a technical editor, as opposed to a normal editor, should pick up on? It just reminds me of the stupid novel [slashdot.org] and film [feardotcom.com] writers that title their works with domain names already in use by others. It's just not necessary.

Re:Spending a paragraph being a grammar nazi ... (1)

Scaba (183684) | more than 6 years ago | (#22326636)

Speaking of technical editing, why is it so common to see crap like yourdomain in books?

How common is it? Do you have data?

It just reminds me of the stupid novel and film writers that title their works with domain names already in use by others. It's just not necessary.

Oh, I dunno. "Example.com" just doesn't have the same dark overtones that "Fear.com" does.

Re:Spending a paragraph being a grammar nazi ... (1)

osu-neko (2604) | more than 6 years ago | (#22329394)

How common is it?

More common than it should be.

Do you have data?

The book in question provides one example. Since there should be no examples (see RFC 2606), the existence of one example provides sufficient data to prove the previous assertion to be true.

Re:Spending a paragraph being a grammar nazi ... (0)

Anonymous Coward | more than 6 years ago | (#22325636)

I call Godwin's Law!

Er, Drupal 5? (1)

aitala (111068) | more than 6 years ago | (#22324128)

Wow, just in time for Drupal 6 to come out! heh

Actually I might buy this book...

Dr.E

Re:Er, Drupal 5? (1)

garcia (6573) | more than 6 years ago | (#22324414)

Why when you can view everything you need to know about Drupal themes (including version 6+) here [drupal.org] . You basically unpack the theme, put it in the themes directory, and go into the admin panel to enable it.

There, I just condensed 260 pages that costs money into something free and easy to do. As far as modifying your CSS to find your custom needs, well, that's for a completely different book and one that I would actually read -- if it helped more than what I've been able to learn myself online.

Re:Er, Drupal 5? (1)

aitala (111068) | more than 6 years ago | (#22324546)

Well, I will probably stick to Drupal 5 for quite a while and am going to customize a third party Drupal theme (Denver) to make it do what I want...
I need to be able to work my users into the new Drupal system since I've been using Post-Nuke for 6-7 years now.

Dr.E

Re:Er, Drupal 5? (1)

kestasjk (933987) | more than 6 years ago | (#22324578)

Why when you can view everything you need to know about Drupal themes (including version 6+) here [drupal.org] . You basically unpack the theme, put it in the themes directory, and go into the admin panel to enable it.

There, I just condensed 260 pages that costs money into something free and easy to do. As far as modifying your CSS to find your custom needs, well, that's for a completely different book and one that I would actually read -- if it helped more than what I've been able to learn myself online.
"Download phpBB" -- A book on writing a forum system in PHP "condensed" into 2 words!

Re:Er, Drupal 5? (0)

Anonymous Coward | more than 6 years ago | (#22324804)

"Download phpBB" -- A book on writing a forum system in PHP "condensed" into 2 words

That's pretty much all there is to a phpBB install. Now, if you're going to go into WWIV-style phpBB mods or even custom modding, that's something to discuss at length I suppose.

Re:Er, Drupal 5? (1)

jaymz2k4 (790806) | more than 6 years ago | (#22324948)

i agree that the material is there for free if your willing to dig about or click through a few search results. however, i do find that a good book on the topic can save you a ton of time. i bought the Pro Drupal Dev [amazon.com] book from Apress to get up to speed on the intricacies of drupal and probably saved myself a months worth of mucking around on my own with google & exisiting code.

the theme chapter in that is about 40 or 50 pages long but gives you more than enough to build complicated themes. normally i dont tend to buy technical books as they're too expensive or generic for me but I find that Apress have got some really excellent titles. The Drupal Dev one being my main savior for a while.

A decent, nicely sized book is still much more pleasurable to read than a stack of printed out A4 pages of a PDF or staring at a monitor for hours...

Re:Er, Drupal 5? (1, Troll)

xhrit (915936) | more than 6 years ago | (#22325144)

People will buy the book so they can...

...support teh community.

...put it on the bookshelf next to all the other programming books they have never read, just to impress all their non-programmer friends.

...read it on the bus on their way to work in a soulless code factory pumping out overpriced generic websites for clueless clients.

...have something to throw when you waste a day and a half learning to deal with drupal's idiosyncrasies.

...hold it in the corner crying after none ov the 300+ people on the #drupal-support freenode chan is any help, and the simple 5 page website that would have taken you a day to write in html is three weeks overdue.

A whole book just for themes? (1)

matria (157464) | more than 6 years ago | (#22324130)

The CMS I've been using for three years now just uses a basic HTML page as a theme, you add simple tag-based elements such as [*pagetitle*] or [*content*] to get the dynamic content for each page requested. You can just copy any web page's source and replace the relevant text output sections with these dynamic tags, for everything from menus and login forms to complex AJAX data grid displays.

http://modxcms.com/ [modxcms.com]

Re:A whole book just for themes? (1)

morgan_greywolf (835522) | more than 6 years ago | (#22324404)

I dunno. It took me maybe an hour or two at the most to hack an existing theme into something that looked pretty decent. Including creating the image in the header.

Re:A whole book just for themes? (1)

tehpuppet (1065678) | more than 6 years ago | (#22324884)

Agreed - I found it quite simple to do away with many of Drupal's output snippets, eg hard-coding things like the site's logo image. If you're capable of making your own template you probably don't need that stuff dynamically generated. I think I needed only four or five small PHP snippets in my HTML template.

Re:A whole book just for themes? (4, Informative)

yelvington (8169) | more than 6 years ago | (#22324944)

If you read the Drupal theme developer's guide [drupal.org] you'd know that basic Drupal theming works exactly that way. A page template is simply an HTML page with tags inserted where you want specific components to appear.

The power of Drupal's approach to theming is that you can do as little, or as much, customization of detailed component formatting as you want.

It's a site development platform, not simple blogware that lets you play with look and feel. This is why the Onion [theonion.com] , HamptonRoads.com [hamptonroads.com] , New York Observer [observer.com] and Ozzy Osborne's website [ozzyosbourne.com] can all run Drupal but not look or act like my weblog [yelvington.com] or JumpTV [jumptv.com] .

Re:A whole book just for themes? (1)

xhrit (915936) | more than 6 years ago | (#22326388)

Lets not forget the Quake Wars community site.

http://community.enemyterritory.com/ [enemyterritory.com]

I see that in the case ov your blog you took advantage ov Drupal's approach to theming and did as little customization of detailed component formatting as possible. Next time at least change teh favicon!!! :)

Re:A whole book just for themes? (1)

juiceCake (772608) | more than 6 years ago | (#22324958)

Indeed. You just create your own CSS and XHTML and go, no theming system to adapt to (or you can download free "themes" of course.) I've converted many sites to MODx very quickly.

But CMS's are like operating systems to people I find. Reasons for loving or despising them are as varied as the individuals who use them. I hated all CMS's that I had to learn a templating system rather than being able to use standard HTML and that, together with MODx's modular, don't have to hack the core approach, and the wayfinder, got me onto to it.

I did not care for Drupal's system at all, or much worse, Joomla, but interests and features of importance vary. You need about a page to explain MODx's templates.

YOU FAIL IT (-1, Offtopic)

Anonymous Coward | more than 6 years ago | (#22324234)

all 4now we want.

Errata error? (1)

richie2000 (159732) | more than 6 years ago | (#22324270)

The author states that enabling a theme and setting it as the default, applies it to "both front end and back end of the site" (page 31). Actually, it only changes the front-end theme; the back-end theme is set via Administer > Site configuration > Administration theme; oddly, he actually acknowledges this much later.
Actually, that setting DOES change both the main and admin theme, unless the admin theme setting is specifically changed to another theme. Its default is to follow the main theme setting.

...another (2, Informative)

richie2000 (159732) | more than 6 years ago | (#22324326)

In the section describing how to set up the menus, the weights for the "Home" and "Contact Us" links are supposedly set to 10 and -10, respectively, which would place the former to the left of the latter; yet the illustration on page 148 shows the opposite.
A menu item with a weight of -10 would always be displayed to the left/above one with a weight of 10. "Lighter" values float, "heavier" sink. A "Home" with a weight of 10 would therefore be displayed to the right of "Contact Us".

On Errors (2, Informative)

seyyah (986027) | more than 6 years ago | (#22324412)

The alert reader will spot other signs of sloppy editing: One pages 18-19, the author should have chosen either "Tables Free" or "CSS-based," and be consistent.

Pot calling the kettle black?

In all seriousness, instead of blaming the author for these problems, the reviewer should be blaming the publisher. Where were the editors? As the quote shows, mistakes are easy to make, but when it comes to print, any half-decent publishing house should be catching them.

Re:On Errors (1, Insightful)

Anonymous Coward | more than 6 years ago | (#22324494)

In all seriousness, instead of blaming the author for these problems, the reviewer should be blaming the publisher.

Uh, did you visit the reviewer's webpage as linked in the review? He's not the best at his job, either.

Re:On Errors (0)

Anonymous Coward | more than 6 years ago | (#22325294)

Uh, did you visit the reviewer's webpage as linked in the review? He's not the best at his job, either.
No joke. I bet people are lining up outside his door for web development work with a snazzy looking site like that.

the problem with drupal... (1)

mmport80 (588332) | more than 6 years ago | (#22324666)

... is (unless they've fixed this) that if you want to update your site, you have to update every incremental update to finally get the latest update. basically the whole updating thing is a lot more complicated than it should be.

Re:the problem with drupal... (1)

ChangeOnInstall (589099) | more than 6 years ago | (#22325142)

... is (unless they've fixed this) that if you want to update your site, you have to update every incremental update to finally get the latest update. basically the whole updating thing is a lot more complicated than it should be.
I upgraded from 5.5 to 5.7 without hitting 5.6. Just removed the main drupal directory, replaced it with the 5.7 directory, then moved the files (uploads) and 3rd party modules back into place. Then visited their update scripts. By far the most painless upgrade experience I've ever seen on an PHP-based item.

I don't claim to be an expert on Drupal, and I did try this on a test server first.

Re:the problem with drupal... (1)

dvessel (971554) | more than 6 years ago | (#22330250)

Point updates you can skip. Major updates do need to be hit. For example, going from 4.8 to 6.0 can cause trouble. It's possible but you have to know what your doing. 5.0 to 5.7 shouldn't be a problem and I don't remember that ever being an issue.

Lots of drupal themes made, zero 260 page books (1)

Shayneisgreat (1052124) | more than 6 years ago | (#22324698)

Our company makes Drupal websites for many customers with ease. It is very flexible and easy. I can't imagine needing a 260 page book to work with it. http://www.kirkhamsystems.com/ [kirkhamsystems.com]

Re:Lots of drupal themes made, zero 260 page books (1, Insightful)

Anonymous Coward | more than 6 years ago | (#22325152)

Dude, your company's home page sucks at 1024x768 -- if web design services are what you are offering, try to think about who the users of your designs are going to be, and how functional they are not when your table-of-contents take up 50% of the screen...

Quality of Drupal (1)

Aethedor (973725) | more than 6 years ago | (#22324920)

Drupal is a nice example of how a piece of junk software can become popular. Their code structure looks like OO, but it isn't. Instead, they use their own hooking system, which makes the software slow (talking about hundreds of DB queries to build a simple page) and more complex then necessary. No offense, but the fact that Drupal is popular tells me more about the programming skills of the average webdeveloper then it tells me about the quality of Drupal.

Re:Quality of Drupal (2, Informative)

yelvington (8169) | more than 6 years ago | (#22325072)

From http://api.drupal.org/api/file/developer/topics/oop.html [drupal.org] :

Drupal often gets criticized by newcomers who believe that object-oriented programming (OOP) is always the best way to design software architecture, and since they do not see the word "class" in the Drupal code, it must be inferior to other solutions. In fact, it is true that Drupal does not use many of the OOP features of PHP, but it is a mistake to think that the use of classes is synonymous with object-oriented design. This article will cover several of the features of Drupal from an object-oriented perspective, so programmers comfortable with that paradigm can begin to feel at home in the Drupal code base, and hopefully be able to choose the right tool for the job.


As for the number of queries used in Drupal, learn to use the cache system:
http://www.lullabot.com/articles/a_beginners_guide_to_caching_data [lullabot.com]

Re:Quality of Drupal (1)

Aethedor (973725) | more than 6 years ago | (#22331470)

Cache system or no cache system, why does Drupal query the database 20x more than I would do to build a simple page??

Re:Quality of Drupal (1)

truthsearch (249536) | more than 6 years ago | (#22325104)

Their code structure looks like OO, but it isn't.

How does it look like OO? It's functional. It doesn't pretend to be object oriented. Maybe you're confusing modular code layout with classes?

Instead, they use their own hooking system, which makes the software slow (talking about hundreds of DB queries to build a simple page) and more complex then necessary.

What does the choice of building a custom hooking system have to do with the number of database queries? An object oriented design could easily cause the same number of queries to be executed.

As for speed I haven't found Drupal any slower than any other PHP CMS. They fixed the big performance bottlenecks years ago.

And the advantage to the large number of queries is the simplicity of the code. In Drupal's case, consolidating queries would make the code (and modularity, specifically) much more complicated. MySQL's strength is in running many small queries very fast, so in some cases it's beneficial to build a simple CMS with many smaller queries when using MySQL.

Re:Quality of Drupal (1)

Aethedor (973725) | more than 6 years ago | (#22331504)

How does the code look like OO? Because of the hooks. It's what you do with object inheritance: you override default functions. What has that to do with the number of queries? Because of the hooks, functions which are not required to build a page, are called nevertheless. These useless function calls (which query the database) make Drupal slow. Of course you can attack me saying I'm a bad programmer or I don't understand Drupal. I took Drupal 5.3 and the FAQ module from the Drupal website. It took 418 database queries to build a FAQ page. Yes,.... 418 queries! And please, don't give me some pointless reason why that would still be my fault. It will make you the smoker who says cigarettes aren't bad.

Re:Quality of Drupal (1)

truthsearch (249536) | more than 6 years ago | (#22334572)

I don't know your exact situation, so I can't comment on the 418 queries. But I am very intimate with Drupal's internals. All of the useless function calls keep module development simple. And it does cause excessive PHP code to run. Since most module functions are very short it's cheap. But unless your external modules are very poorly coded they should not cause any extra database calls. I've professionally built a number of very complex sites with Drupal and I've extensively debugged the hooks and database queries. It's extremely rare that any part of the core, including the built-in modules, run any extra database queries.

Let's say, for example, that you have a basic Drupal site with every module turned on and just the user block in a sidebar. If you browse the blog, hooks in the forum module will be called (nodeapi, for example, since any module can append to the behavior of any node). But no queries from the forum module will be executed.

Re:Quality of Drupal (1)

osu-neko (2604) | more than 6 years ago | (#22329488)

Uh huh...

One way to spot a rookie is that they think whether something is OO or not is relevant to whether it's efficient or even well-designed or not.

Re:Quality of Drupal (1)

Aethedor (973725) | more than 6 years ago | (#22331460)

One way to spot a person who wants to make a point but doesn't have one, is to look for a person who attacks the messenger, not the message.

Scripts with moderation support? (1)

Slaggard (1217194) | more than 6 years ago | (#22325130)

I'm interested in blogs/CMS's/whatever that support moderation and decentralized editorial/administrative control. I've looked at Slash and Scoop, but they're a bit unwieldy for a mere mortal like myself, and (I think) are difficult/impossible to install on a shared hosting server.

Which scripts are the best for this sort of thing? Is Drupal the way to go?

Re:Scripts with moderation support? (0)

Anonymous Coward | more than 6 years ago | (#22325644)

Drupal has a number of options for content moderation. Most use Drupal's centralized Voting API to capture user opinions and hide/show/promote the content based on aggregate ratings.

Free Drupal themes (1)

ElMiguel (117685) | more than 6 years ago | (#22325338)

There are free Drupal themes available on the Net, but I haven't been able to find a nice one with light text on dark background. For some reason there seem to be many more free themes for e.g. Joomla.

You misunderstood... (0)

Anonymous Coward | more than 6 years ago | (#22325370)

On page 40, the author instructs, "To access all the user permissions and configuration screens in one place, view your administrator console by module." But Administer > Site building > Modules is not where the administrator sets user permissions and blog configurations.
He meant on the Administration page to hit By Modules (its at the top).

Some possible non-errors (1)

mdavids (143296) | more than 6 years ago | (#22326172)

I've not read the book, but it occurred to me that some of the errors complained of above might not be errors, or at worst just insufficiently explained Drupalisms.

some URLs contain root directory slashes, while others do not

You might be conflating relative URLs with "Drupal paths" here. Most Drupal sites these days use Apache mod_rewrite to convert a URL like:

http://www.example.com/?q=admin/content/types

to:

http://www.example.com/admin/content/types

The distinction between Drupal paths and URLs relative to the site's base directory is important, because your Drupal site might be in a subdirectory of your web server's root directory (eg. http://www.example.com/mysite/ [example.com] ).

Some menu breadcrumbs use ">" as a delimiter, while others use "|."

The breadcrumb delimiter is itself themeable. This would just be reflecting real world experience, so I can't see any benefit to this degree of consistency.

"Dev Server" (page 120) apparently means a local Web server

I would have expected that anybody ready to tackle Drupal theming would be familiar with the concept of using a development server (possibly but not necessarily on your local machine) to safely make modifications before transferring them to the live site, and that a definition here would be irritatingly redundant.

New Javascript Theme Assistant (0)

Anonymous Coward | more than 6 years ago | (#22326642)

Why has no one mentioned the new javascript theming assistant for Drupal 6. Simply click in an area and it will tell you what function creates that output and it allows you to very easily patch up themes!

What! "Skins" weren't mentioned? (0)

Anonymous Coward | more than 6 years ago | (#22328484)

Off with his head!

Actually I get a little tired of hearing about "skins". There's more to a theme than gathering up a set of alternate graphical elements. (When I hear "skins", for example, I'm more often than not, going to think about the pretty much useless variations one can make to the appearance of something like XMMS, most of which -- though they may make it look like it was designed by Giger -- almost always make its display next to unreadable.) A theme can include font selection and, if it's CSS-based, a customized way of dealing with just about every element of the web page. Geez, more than a few of the reviewer's complaints seemed just a little too picky. A double period at the end of a sentence! I guess we ought to be asking for a price reduction at the register since the book is so obviously damaged.

More mistakes in the review. (1)

Narcogen (666692) | more than 6 years ago | (#22328664)

There are more mistakes regarding Drupal in the review than are pointed out in the book.
Some menu breadcrumbs use ">" as a delimiter, while others use "|."
Because some Drupal themes use > as the breadcrumb delimiter, and some use |. This is entirely up to the theme author. Very likely those entries were cut and pasted directly from the Drupal output being referred to.
The author states that enabling a theme and setting it as the default, applies it to "both front end and back end of the site" (page 31). Actually, it only changes the front-end theme; the back-end theme is set via Administer > Site configuration > Administration theme; oddly, he actually acknowledges this much later.
Because it only needs to be acknowledged later. By default, the setting for Administration theme is "system" which makes the administration (backend) theme the same as the site's (frontend) theme. It can be overridden by the site administrator to be any other theme, but until this default setting is changed (in other words, until the existence of it is mentioned) the statement above that setting a theme to default affects both the frontend and backend is accurate.
In the theme configuration screenshots in Chapter 2, the "gagarin" theme is missing, even though it was supposedly installed earlier.
So?
On page 40, the author instructs, "To access all the user permissions and configuration screens in one place, view your administrator console by module." But Administer > Site building > Modules is not where the administrator sets user permissions and blog configurations.
Administer > Site building > Modules is not the administrator console by module.
/admin in Drupal 5 by default is the Administration by Task console. It groups administrative options by grouping them into various task-related subgroups. Across the top of the page there is an option to display those options grouped by the module they are associated with, instead of the tasks they perform. The URL for that is admin/by-module, not admin/build/modules.
The figure caption on page 50 could give a reader the mistaken idea that Drupal renames the custom logo image to "garland_logo.gif"
It does. If you upload a custom logo while editing site-specific themes, the image is uploaded and given a name that labels it as specific to that theme. If you instead enter in a path to a custom logo the file is neither renamed or moved.
In the section describing how to set up the menus, the weights for the "Home" and "Contact Us" links are supposedly set to 10 and -10, respectively, which would place the former to the left of the latter; yet the illustration on page 148 shows the opposite.
You are mistaken. If "Contact Us" is weighted -10 and "Home" is weighted 10 then "Contact Us" will appear first, on the left, and "Home" will appear next, on the right (assuming there are no other menu items). Drupal's weighting system has always worked on the basis of the concept that lower numbered, or "lighter" items float to the top, while higher numbered items, or "heavy" items, sink to the bottom. Hence the use of the term "weight".
At a glance I'd say that this review is evidence that more than a passing familiarity with Drupal is necessary to provide a really useful review of a book covering this topic, unless one merely wishes to assert that one is a better copyeditor than the one at Packt.

Why? (1)

thePowerOfGrayskull (905905) | more than 6 years ago | (#22329740)

Yet another book that sells information freely available. Not to mention one that is rather poorly written, to all appearances...
Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...