Syndicate

Feed

Building powerful and robust websites with Drupal 6

Packt recently published an expanded and updated edition of Drupal: Creating Blogs, Forums, Portals, and Community Websites. The new title is Building powerful and robust websites with Drupal 6, and it contains 362 pages with the index — 100 more pages than there was in the first book. The author, David Mercer, would like his book to become the Drupal community's de facto title for learning the technology, a helping hand that will move new comers faster passed the 'Drupal sucks' passage obligé. (Drupal has a steep learning curve, everyone knows that.) The book, in my opinion, will indeed save newbies countless hours of aggravation. It contains information that I found quite useful, although the book is not targeted for developers, nor themers (Packt has another title that decently covers theming, but for Drupal 5). David Mercer spends much time discussing web technologies used with and around Drupal. For example, you'll learn how to install a server on your machine (Apache2Triad), and will get an introduction to HTML! You will not here learn how to install multiple sites that use the same code base, you won't know the steps by which you create a virtual host on your development machine, nor will you learn to properly reference image files in your site content (I will come back to this, when reviewing chapter 7). Most information pertaining to 'scaling' and performance relayed by Mercer can be read right from the Drupal interface. (Nothing particularly new here...). I'd like to mention right off that the book's instructions on how to install a language translation are incorrect. (I'll come back to this as well, when I review chapter 9.) This is probably due to changes brought to Drupal 6 after the chapter was written and reviewed. I should also mention that there is an excellent coverage of several contributed modules. You'll find in this book the best introduction I've seen to CCK.

I did not bookmark so much the book Building powerful and robust websites with Drupal 6.

Per chapter detailed review

CHAPTER 1 covers how Drupal came to be and what it has to offer. You get a tour of the Drupal.org web site. (Mercer mentions the sheer number of support-related posts in the Drupal forums: 200,000). Forums have an advantage over Drupal's IRC channels: forums are archived, and hence searchable. We learn how important it is to know where we're going, when we build a new web site. Some suggestions: we can list requirements by looking at other web sites (p.14), or play the role of the user (same page).

In CHAPTER 2, we install Apache2Triad on our development machine. Since I never used this package myself, I learned that the 'triad' word refers to Perl, PHP and Python, and that Apache2Triad also installs MySQL. Once we've set up our local server, we download and install Drupal 6 using a fresh (empty) database. We are directed to an appendix to learn how to upgrade a Drupal 5 web site to Drupal 6. Cron jobs are not discussed at this point, the author points us to chapter 10, 'Managing your web site', where they receive a fair treatment. The following is often overlooked: we (as 'admin') can view the Administer section 'By module', rather than 'By task', which is the default. Mercer makes good use of this particular view. In this chapter, we also get to install and configure a contributed module, DHTML Menu. (A module you won't be able to live without.)

Using the 'By module' view in the Admin panel

In CHAPTER 3, we build a wildlife and conservation web site. We install forums and create content for them, we post a comment, and we learn how to use blocks. We take a close look at the search module configuration page. We learn that we can weigh the importance of three indexing criteria, which affect the order of search results. I learned how to re-index a web site, and then run cron.php manually so that the re-indexing is done right away. This can be very useful. Say you want to place Ad-Sense ads on your site. You need to remove some words from your content, before you seek approval from the censors at Google. You edit your content, but some words still turn up in your web site search results. You are in a hurry, so you want to re-index your content right away. You go to admin/settings/search and press on the button 'Re-index site'. Then you go to admin/reports/status/run-cron.

In this chapter, we also create a custom block. When setting the visibility of blocks per page, I've often seen the use of forum along with forum/* to make sure that a block is displayed only on forums page, or never shown there, where a simple forum* will suffice. Mercer uses forum*.

There is a difference between blog/* and blog*. Can you tell what it is? (Answer: using the first expression, the page 'blog' is excluded.)

It's in this chapter that we learn that (read slowly...), when we put the primary links in the header, the child links of 'primary links' become parent links in 'secondary links' when the 'source' of 'secondary links' is set to 'primary links'.

CHAPTER 4 covers things we modify or set only once (usually), such as clean URLs (turned on automatically during the Drupal 6 installation), and the download method. We learn that aliasing is a good idea, and are invited to skip ahead and learn how to use the modules Path and Pathauto, covered in chapter 10. We learn how to be both user and search engine friendly.

I was reminded that custom messages can be presented to the user whenever the content he's trying to see is restricted ('access denied') or 'not found'.

Unfortunately, Mercer does not explain how private [download] can interfere with the proper working of other parts of the site What parts??? For private download, the author sets his file path to the following absolute path:c:\apache2triad\files (p.104), instead of using, more appropriately, the relative path ../files. Something else I was reminded of: the List checkbox in the node form for 'File attachments' must be unchecked if 1- the attachment is an image and we want to show this image in the content of the node, or 2- we want to link to the attached file —any type of file— from within the node's content, inline with some text, or using a special button.

CHAPTER 5 covers 'who does what' on the web site, that is, permissions, roles, and access rules. Here's a trick: you probably have two browsers on your machine (at least). If you do, use browser 1 for admin, and browser 2 for the 'bogus' test user you've created, whenever you wish to test who can see and do what on your web site (p.122). We're reminded in this chapter that any user who has an admin-defined role (such as role moderator) is also an authenticated user. Also, a user who belongs to role x and role y will get combined permissions of roles x and y. That means that if role x is allowed to Do Something, and role y isn't, the user will be able to Do Something. That is why one should create special roles by adding the specific additional permissions that are required by that role, and no more. (p.126). Very wise. Book-marked :-)

As a side note, still in Drupal 6, there is no way for a blogger to administer comments posted on his own blog. There is only a catch-all permission to edit/delete comments posted site-wide.

In CHAPTER 6, we learn how to generate simple content and administer it. There is a very nice coverage of the core modules Aggregator and Book.

You can download  CHAPTER 7, ''Advanced Content", from the publisher's web site. This chapter covers taxonomy and CCK, that is, custom content type creation. We learn that a taxonomy is a hierarchy of 'terms', unlike thesauri, which define 'is similar to' relationships. The contributed module Similar By Terms is mentioned. We learn that multiple vocabularies can be used to provide faceted tagging, although the example used by Mercer to illustrate this concept is weak. It's only further down the road in one of the last chapters (and not by accident, I believe) that we learn that it's possible to access lists of content through their tagged terms using system paths such as /taxonomy/term/1+4.

Coverage of CCK is excellent. We download the contrib module Fivestar to learn how to add a 'contributed field' to a content type, but it's not clear why we would want to do this when we can enable the Fivestar widget for any content type (another contrived how-to example). The chapter also covers input formats and filters, how the former can be created, and how the latter can be rearranged (the order in which they are applied). When creating a 'feature-rich' page, we attach an image file to our node, and display the image in the content using an <img> tag with the 'src' attribute set to: http://localhost/mf4good/sites/default/files/team.jpg. This link will be broken when the file structure will change, such as after deployment. A site root-relative path is preferred: /sites/default/files/team.jpg or, in the case where the content may be posted on another web site through a feed, the URL of the file is even better: http://mf4good.com/sites/default/files/team.jpg. This seems perhaps convoluted, but there are issues to consider in Drupal whenever we're referencing pages, images or any file within a node or block's content, when using clean URLs! Beware.

CHAPTER 8 discusses theming. As an exercise, we download, install and customize the Barlow theme. The modifications we bring to it are simple: we upload a new logo (that you'll need to make yourself), we style blocks by modifying block.tpl.php and by adding a few rules to style.css (and, again, using PNG images you'll need to produce yourself), and we change the background image (and you have guessed it, by replacing the background image with another one you will pull out of your...).

In CHAPTER 9, we learn about Actions and Triggers, new to Drupal 6. We also learn how to install a language translation the wrong way ;-) We learn to add a new language and then import to it a .po file that we download from drupal.org. When in fact, no manual 'import' is necessary. What needs to be done is 1) Get the translation tar ball (*.tar.gz file) from http://drupal.org/project/Translations, then move this file to your web root (in the same folder as index.php), then extract the file. Every extracted .po file (as there are many, many) ends up where it's supposed to be. The translation package has a tree structure, that of your Drupal installation. Then and only then, you add the language (going to admin/settings/language/add). At that point, the importing of all .po files is done automatically for you by Drupal.

Using 7zip to extract a French translation.

If we want to translate the interface ourselves, Mercer recommends the use of a contributed module, Localization client, and shows us how to use it. This chapter provides an excellent coverage of content translation, as well. (Interface translation is one thing, content translation is another.) In a section about Drupal caching, Mercer talks about the contributed module CacheExclude which enables one to disable cache for certain pages. Then he offers a very brief jQuery introduction, presenting us with a contrived example script. (We are far away from the succinct yet powerful treatment jQuery gets in the book Pro Drupal Development.)

In CHAPTER 10, we learn how to use the modules Path and Pathauto for path aliasing. We learn how to run crontab, and how to make a backup of our web site. Mercer shares with us a list of guidelines to help with SEO (Search Engine Optimization). I learned that providing a site map boosts Google ranking, and that the Drupal community contributed a module to build such map, XML Sitemap.

The author adopts a conversational tone (as I do here), is very thorough in his coverage of the Drupal interface, and provides a handful of screen captures in most places.

Where the book falls somewhat short in its delivery

  • The book needs more polishing in a few places. The chapter on 'Advanced Content' (the one free to download) seems to have skipped proofreading, as it contains several glaring typos.
  • The book is printed in black and white, and that is just fine. However, the screen captures look like photocopies of photocopies (faxed to the publisher). Although these screenshots are legible, for the price one would expect a better presentation.
  • The book puts too much emphasis on general recommendations (such as Try not to chop and change too often once the site is live), and spends too much time discussing web technologies despite the author's objective to have provided more concentrated information. For example, Mercer talks in length about the different image formats used on the web, and introduces the reader to CSS and HTML. He spends too little time discussing the working of the PHPTemplate engine. Theming is only brushed upon. While he recommends against using PNG images because IE6 does not render their transparency (there is a jQuery plugin, by the way, that fixes this problem), he goes right along and uses .png files to style blocks in the modified Barlow theme a few pages after. There is no source code nor image files to download on the publisher's web site. (Not yet, anyway.) However, the latter doesn't make it hard to follow along when modifying the Barlow theme, provided one produces his own image files.
  • As an exercise in the book we add a social bookmarking script to a custom block. The social bookmarking web site was founded by David Mercer (I found this out while googling). Later on, in chapter 10 p.336, Mercer promotes his web site: Social media sites are also a good place to go—mentioning your blog on Digg or saving it to L... [his web site] exposes your pages to a whole new target audience. I had never heard of L. before...

A Missing Manual

This is the 'Missing Manual' anyone new to Drupal should read as he or she installs and starts playing with Drupal. The Drupal interface is very intricate, and even an experienced drupaler will tend to forget to look in certain places. It's not unlike a big house with many different rooms and closets. By reading this book, an advanced beginner or an intermediate user will certainly be reminded of a few simple but remarkable features.

Contributed modules 'covered' in the book

Last edited by Caroline Schnapp about 14 years ago.

Comments

Thanks

I liked what I found here, very useful an practical. good work.

I am very glad that you appreciated this review

I received the book as a gift, in exchange for my publishing a review for it. My review fairly reflected my opinions. I spent a lot of time on this... Reading a book for the sake of learning is not quite the same as reading for reviewing. For me at least, the task of reading for reviewing (and learning) is pretty time-consuming. I am so very pleased that you got something from my effort.

Have a splendid day!

I'll have to come back to this review

Hi, I have used this book in the last few weeks to learn how to use Drupal (having used Joomla in the months before). The book is a good introduction but left me with some areas where I wanted to know more. The book should explain Views in detail because I consider this a vital module, perhaps using a Drupal 5 working example or a downloadable book update when Views is available for Drupal 6. The review you did on this page is more than a review and adds some information missing from the book. Thanks!

So, I'll have to return here and soak up the info when I am in a better state-of-mind: I am too excited now because for this morning I have set myself the target of finally deploying my first Drupal site on my host account, the last thing I need now is to learn more great stuff about Drupal that is postponing the swap from my site using Joomla to Drupal.

This review was amazing. I

This review was amazing. I havn't purchased this book, but already I have learned a ton just by reading all your info above. My current Developer site uses Drupal 5 and I'm getting ready to upgrade. I've looked into this book and will probably still buy it even though it has some shortcomings. Thanks for filling many of those in. I appreciate it!

Great blog.

Great blog.

That's all Absolutely

That's all Absolutely remarkable, I recognize that you are a hard skilled blogger. I’ve joined already your RSS feed and look forward to seeking more of by fantastic articles. Also, I have shared your web page on my social networks pages.
Mehul Holidays | Manali Holidays

The google has a published

The google has a published criteria for the web sites they accept to the Adsense program. A good rule of thumb is just construct an honest and forthright web site that has legitimate purpose other than attaining revenue from the Google Adsense program.

(Nothing particularly new

(Nothing particularly new here...). I'd like to mention right off that the book's instructions on how to install a language translation are incorrect. (I'll come back to e-papierosy this as well, when I review chapter 9.) This is probably due to changes brought to Drupal 6 e-papierosy after the chapter was written and reviewed. I should also mention that there is an excellent coverage of several contributed modules. You'll find in this book the best introduction I've seen to CCK.