Archive for the Category » Computer Programming «

Thursday, December 04th, 2008 | Author: Brian Stevenson

Part 2 of an 11-part review of Drupal 6 Themes. by Ric Shreves

fat ass butt chair
If I were to describe chapter 2 with one phrase I would say, “Too much!” As I was reading it, I realized that it would have been better written as two chapters, not one. Using the table of contents, I counted the average number of pages in each chapter; the average chapter is 15-25 long. Chapter 2 is 39 pages long, which is 15-24 pages longer than the average chapter. You might be thinking to yourself, “Gosh Brian, why are you being so fussy?” Let me tell you why.

Chapter 2 completely ended my moment and enthusiasm for completing this book. I had set a goal to read this book at a pace of one chapter per day. Pretty reasonable, don’t you think? Well, I wasn’t able to finish Chapter 2 in one sitting, or two sittings… rather it took me three sittings over three days to finish it! In general, I prefer books that have a regular rhythm. And, when it comes to educational books, I prefer the information in small chunks, not large ones.

I’ll get off my soapbox now.

Here is an outline of Chapter 2:

Finding Additional Themes (p. 31)
Installing and Additional Theme (p. 35)
Configuring a Theme (p. 40)
  - Theme-Specific Configuration Options (p. 40)
  - Color Picker (p. 42)
  - Enable/Disable Page Elements (p. 43)
  - Logo Settings (p. 44)
  - Shortcut Icon Settings (p. 45)
  - Global Configuration Settings (p. 45)
Managing Modules and Blocks (p. 47)
  - The Module Manager (p. 47)
  - The Blocks Manager (p. 49)
    - Configuring Individual Blocks (p. 51)
      - Block Title (p. 52)
      - User Specific Visibility Settings (p. 53)
      - Role Specific Visibility Settings (p. 53)
      - Page Specific Visibility Settings (p. 53)
    - Adding PHP to Blocks (p. 54)
Theming in Action: Dressing up Garland (p. 56)
  - Set the Color Scheme (p. 58)
  - Set Page Elements (Toggle Display Settings) (p. 58)
  - Upload Logo (p. 59)
  - Global Site Information (p. 60)
  - Enable Modules (p. 61)
  - Manage Blocks (p. 62)
  - Add Some Dummy Content and Links (p. 64)
  - Set Access Levels (p. 65)
  - Create a Custom Block (p. 65)
  - Set Block Visibility (p. 67)
Uninstalling Themes (p. 68)
Summary (p. 68)

On Page 47, there was a rather unnatural shift from talking about themes to talking about modules. Considering the first half of the chapter was able theme configuration, they probably could have done a better segue to modules and blocks. Or, better yet, group that portion (pg. 47-55) with the latter half of the chapter that talked about modules and blocks (pg. 61, 62, 65).

The chapter did a poor job with explaining how to do some the exercises. It was like certain portions of the chapter were an afterthought and written in a completely different frame of mind. It made overly-optimistic assumptions about the reader’s level of understanding. This was apparent on pages 64 and 65 with the “Add Some Dummy Content and Links” and the “Create a Custom Block” section.

Chapter 2 Grade Card:
Content Usefulness: B+
Content Organization: C-
Spelling & Grammar: B+ (1 spelling mistake)
Hands-on Practice: B+
Code Examples: A+
Overall: B

Next up, Working with Theme Engines.

Thursday, October 16th, 2008 | Author: Brian Stevenson

Part 1 of an 11-part review of Ric Shreve’s Drupal 6 Themes.

Drupal 6 Themes – The Elements of a Drupal Theme

If I were to describe chapter 1 with one word I would say “Out-of-order”. Ok, that’s technically 3 words, but the point I’m trying to make is that it was a weak introduction to this book. “Brian, how would you have improved this chapter?” I’m glad you asked. :-P

Let me start by saying there was a lack of an introduction. Granted, there was a preface, but it was the standard boilerplate preface that you find in the beginning of every Packt book. Without an adequate introduction, it feels like one is jumping head first into an ice-cold swimming pool without first dipping a toe to get used to the temperature! I think it would have been a good idea to encourage the reader first and then take a few pages to introduce some of the basics of the Drupal CMS. This would ensure that everyone, even those new to Drupal, will establish a solid reference point.

To make things worse, the first few pages of chapter one jump immediately into some theming concepts as if I had prior knowledge of Drupal theming! Then, somewhere in the middle of the chapter, he decides to define the basic terminology with sections such as, “What is a Theme?” Perhaps this chapter got mangled in the editing process, who knows.

If I were to strictly rearrange the existing sections, and not rewrite any of the content, I would put them in this order:

  1. What Is a Theme? (p. 12)
  2. The Range and Flexibility of Drupal Themes (p. 13)
  3. What you see on the Screen (p. 15)
  4. The Big Picture: How Drupal Displays a Page (p. 18 )
  5. The Importance of Themes in Drupal (p. 7)
  6. Theme It in Whole or in Part (p. 8 )
  7. Build with Blocks (p. 10)
  8. Intercept and Override (p. 11)
  9. The Default Themes of the Drupal Distro (p. 20)
  10. What Is a Theme Engine? (p. 13)
  11. The Theme Files (p. 24)
  12. The Files of a PHPTemplate Theme (p. 26)
  13. The Files of a Pure PHP Theme (p. 28)
  14. Summary (p. 29)

OK, now that I’ve got THAT off my chest, let me get into the things that I liked about chapter one:

  1. He does a good job defining terms.
  2. I like how Ric imparts his wisdom and experience in the form of best practices.
  3. His screenshots and illustrations are easy to understand.

In my own words, here are some best practices or nuggets of information that I can really appreciate from this chapter:

  1. Customize your themes at the highest possible level through intercepting and overriding. Do not alter the core!
  2. Unless you have a really good reason for not using the default PHPTemplate theme engine, you’re better off using the default.
  3. It is possible to design a theme so entire regions will collapse from sight if no blocks are inserted.
  4. Unless you have a really good reason for designing a table-based theme, you will be better off using CSS for all of your region positions because you gain a tremendous amount of flexibility.
  5. You should put your themes in the /sites/all/themes directory to ensure that they are not in the same directory as other core files.
  6. It is a good idea to create a screenshot.png for any custom built themes to help a site administrator preview your theme.

Chapter 1 Grade Card:

Content Usefulness: A-
Content Organization: D+
Spelling & Grammar: A+
Hands-on Practice: N/A
Code Examples: N/A
Overall: B

Next up, Theme Setup and Configuration.

Wednesday, October 08th, 2008 | Author: Brian Stevenson

Drupal 6 Themes, by Ric ShrevesYesterday, I received the long awaited Drupal 6 Themes by Ric Shreves in the mail. I started reading the book and then it dawned on me that it would be a good idea for me to summarize each chapter on my blog so it will help me synthesize my findings before I write a final book review. I’m going to call this exercise WAR (Write As I Read). I am paying homage to Packt Publishing’s “RAW” concept (Read As We Write).

I am going to treat this blog post as a table of contents, so I will update this page with a hyperlink for each chapter that I review:

Chapter 1: The Elements of a Drupal Theme

Chapter 2: Theme Setup & Configuration

Chapter 3: Working With Theme Engines

Chapter 4: Identifying Templates, Style Sheets and Themable Functions

Chapter 5: Intercepts & Overrides

Chapter 6: Modifying an Existing Theme

Chapter 7: Building a New Theme

Chapter 8: Dynamic Theming

Chapter 9: Dealing with Forms

Appendix A: A Guide to Drupal Style Sheets

Appendix B: The Themers’ Toolkit

Monday, August 18th, 2008 | Author: Brian Stevenson

Sexy Drupal Logo

One of my friends from Vineyard Leadership Institute came to me a few months ago with a casual business proposition. Her name is Sylvia and she is the owner of a court reporting firm here in Columbus, Ohio. She knows I am good at creating web sites, so she asked me if I would be interested in revamping her current web site. Since I was going to be graduating from VLI in June, I figured it would be a fun way to spend some of the free time I would have during the summer. So I agreed to help her out and we’ve met a few times to learn about her website needs and to develop a scope for this project.

As I defined the scope, it became apparent that a content management system would be a requirement for this site. So I spent a couple hours evaluating a few products and I was extremely impressed with Drupal! I’m quite familiar with .NET-based CMS systems such as DotNetNuke, RainbowPortal, SharePoint, ektron, etc. I have well versed in Mambo, Joomla, and other PHP-based content management system. So, I thought I had seen it all when it came to CMS. Not so! The more I began to tinker with Drupal, the more I realized that this platform was on track to completely obliterate all PHP-based CMS systems AND make some of the enterprise-level content management systems cry for their mommy. OK, that was a hyperbole, but you get the idea.

So back to what I was talking about…. so I was picking out a CMS and Drupal was clearly the winner. I’ve been spending the last 3 weeks as a student of my self-concocted Drupal boot camp. Basically, I’ve been spending anywhere from 1-4 hours each day learning the system. Learning EVERYTHING I can possibly learn. The documentation for Drupal is surprising good considering the fact that it’s not a commercial product. I’ve bought a 2 books about Drupal to get me started. So far, the first one on the list has been a good resource to get me going with Drupal:

1. Building powerful and robust websites with Drupal 6

2. Learning Drupal 6 Module Development

And I will be buying two more books when they are released by the end of August:

1. Pro Drupal Development, Second Edition (Beginning from Novice to Professional)

2. Practical Drupal: Evaluating and Using a Web Content Management System

So anyway, if you’re considering a CMS for a web site, test drive Drupal and check out some of the Drupal modules and Drupal themes available from the Drupal developer community. It’s quite an active community of developers, which is a very important selling point for me.