Lhmdesign Redesign Write Up
So, as promised, here's the full write up on the Lhmdesign redesign. I'll cover the whole site, but focus mainly on the blog section as it incorporates the more complex setup and theming.
Firstly, then, a few details:
- I built the site in Firefox, with frequent use of the ever awesome Firebug extension.
- IE7 corrections were handled using conditional comments placed in the page.tpl.php file.
- IE6 fixes were handled via a secondary style sheet - a process which I outlined previously here.
- Safari and Opera corrections are a straight up hack:
@media screen and (-webkit-min-device-pixel-ratio:0) {
#divid {
rules: here;
}
} - Blog posts are story nodes which, by default, are promoted to the front page and have comments enabled.
- Blog post tags are a vocabulary (admin/content/taxonomy/add/vocabulary).
The entire site is built on Drupal 5.7. I would have liked to build it on 6.x, but a number of the contributed modules used don't yet have 6.x support, so for now it's 5.7 all the way.
And speaking of modules (smooth eh ;) the ones I've used (excluding core required modules) are:
| LHMDESIGN | MY DRUPAL BLOG | ||
|---|---|---|---|
| Core optional: | Contributed: | Core optional: | Contributed: |
| Color | Dynamic Rendering | Color | Code Filter |
| Comment | Global Redirect | Comment | Comment RSS |
| Help | Meta tags | Help | Dynamic Rendering |
| Menu | Panels | Menu | FeedBurner |
| Pathauto | Path | Global Redirect | |
| Token | Ping | Insert View | |
| Webform | Search | Meta tags | |
| Taxonomy | Pathauto | ||
| Service Links | |||
| Spam | |||
| Switchtheme | |||
| Views | |||
THEMING:
Due to the site being built on Drupal 5.7 the theme is also tailored for Drupal 5.x, so just be aware that all following references are as such.
Lhmdesign Redesigned!
After a few weeks of tinkering, I am pleased today to launch the newly redesigned Lhmdesign.
I'll be posting a detailed explanation of the site's construction (particularly the theming :) in a couple of days time, so please stick any questions you have about the new site in the comments.
Thanks!
Downtime
Just a quick heads up:
I'll shortly be taking the whole site off-line.
Hopefully, it should be back up again within the next 24-48 hours.
Apologies for any inconvenience - I'll try to make this as smooth as possible.
Redesigning Lhmdesign
So, long-story-short, I've decided it's time to give the whole Lhmdesign site, including this blog, a redesign. It's been about a year now since the current design went live and, well, you know what designers are like - fiddlers!
Anyway, as this blog is written for you, I'd like to get your input on what features etc. you think should stay/go/be introduced in the redesign.
Currently, I'm thinking:
Staying
- Most recent posts block
- RSS subscription options
Going
- Random tags cloud block
- Sponsors block
New Stuff
- Most popular posts block
- Top commenters block
- Subscribe via e-mail option
- Recommended block
- Categories block/page
Any thoughts?
Classes For (Almost) Everything In A Drupal Theme
Thanks to the Zen theme there is an awesome bit of code available to Drupal themers which enables the addition of dynamic classes to your body tag based upon a number of different parameters, such as your position and status within a site, like so:

As you can imagine, this is incredibly useful for Drupal theming, as it provides a set of classes on the body which then allow a simple way to target specific areas of a theme via CSS.
I used to end up writing lots of different bits of code into a theme file to achieve this functionality, but the Zen theme does a great job of wrapping it all up in one bundle, and also nicely comments the code so that you can figure out what's happening :)
How to use the code:
Implementing the code into your own theme is a simple two step process:
- Step 1.
Copy the main chunk of code into your template.php file - Step 2.
Edit your theme's page.tpl.php file to add the body classes
Step 1
The main chunk of code you will need lives in the Zen theme's ZENtemplate.php file.
I have edited it slightly to remove any Zen theme specific code (such as references to Zen theme sub-themes).
Copy all of this code (except the opening and closing php tags) and paste it into your theme's template.php file.
(Just be aware that if your theme's template.php file already contains a _phptemplate_variables() function you will need to integrate the new code with your existing code, as you cannot re-declare the same function. Unfortunately, it's difficult to give a more detailed explanation about how to do this as each situation will be different.)
Overriding Drupal's Default RSS Feed Icon
By default, a number of Drupal themes (including Garland) output an RSS feed icon
at the bottom of pages which generate a feed. The feed icon is generated because of the existence of the following code in the page.tpl.php file
<?php print $feed_icons ?>But what if you want a different looking icon? Maybe something larger, or a different color?
Well, there are a couple of ways to achieve this:
- The not-so right way
- The right way
1. The not-so right way
Drupal's default RSS feed icon image is located in your site's folder structure at 'misc/feed.png'. The not-so right way to change it is to simply swap this feed.png image for another feed icon image (just making sure to also name the new image feed.png).
This method will work, but is not recommended. The reason being, that you are effectively overwriting a core file. When you do an upgrade of Drupal, your new feed.png image will be replaced with the original feed.png image and you will need to update it again. This is clearly not a good idea if you have lots of sites or are doing sites for clients who do not know how to do such updates, and ultimately it's just an all round messy solution.
So, a far better solution would be one where we do not alter any core stuff, and the new feed icon remains in place even after an upgrade...this is the right way.
2. The right way
The first thing we need to do is find out what function Drupal is using to output the feed icon. So, go over to Drupal API, and do a search for feed_icon. The search should return one result - theme_feed_icon. This is exactly what we're after. Anytime you see the word 'theme_' at the beginning of a function it means that we can override the function - which is what we want to do in this case.
Theme Template Files in Drupal 6.0
I've just heard about an upcoming Drupal Dojo lesson which joshk is doing on Drupal 6 theming - entitled Dojo Lesson #41: Theme Template Files in Drupal 6.0.
This is definitely worth checking out. The dojo lessons are always informative, and if you can't be there live they're pretty good at providing the screencast for you to watch later on.
Drupal Themes On eBay
Hi everyone.
Firstly, a Happy New Year etc. Work got a bit hectic over the Christmas period which resulted in the lack of posts recently, but I'm gradually cranking back into action.
Anyway, whilst doing a little holiday shopping last month I came across one of the several listings on eBay for Drupal themes. Naturally I had to take a closer look. Imagine my 'surprise' when I found out that this was in fact just a bundle of freely available themes.
I particularly like the part in the ad copy which says:
"They have taken us years to find and explore for quality to save you time and money" - really? Years?
There then follows a 'handy' explanation about how to install and enable your theme, which is written entirely in black font on a black background, and also contains out of date information - nice.
And just to finish off:
"These templates are FREE" - except, of course, when you buy them from this listing - oh dear.
Best to not even get started on the eBay Drupal ebook sellers ;)
Update: Dreamweaver CS3 Extension For Drupal Theming
Around three months ago I wrote about a Dreamweaver CS3 extension for Drupal theming which was being developed by Peter Apokotos, and about which a discussion was happening at the time on the themes mailing list. In the meantime another extension has been discussed on the mailing list, as well as on drupal.org, this time being developed by Sherif Mayika.
The two projects are currently completely separate. According to Sherif, his extension will have support for versions 4,5, and 6 of Drupal and is soon to reach beta. I contacted Peter about the progress of his extension and he told me that 'we have a working extension with just about everything but the kitchen sink in it.' So it looks like Drupal theming is going to be getting some Dreamweaver extension love anytime soon.
One thing that, as far as I'm aware, neither Sherif nor Peter have confirmed yet is whether the extensions will be free or not.
5 Things Drupal Could Learn From WordPress About Themes
OK, so before everyone starts sharpening their knives I would like to make a couple of points:
- I am not a closet WordPress fanboy ;) I have just been playing around with WordPress theming a bit lately, and these are some (hopefully) fairly objective observations.
- Drupal is in competition with WordPress. If Drupal can learn from WordPress in areas where WordPress is superior, and improve upon and surpass WordPress in those areas, ultimately it will help Drupal kick some WordPress butt.
All that said, here goes:
1. Pictures sell
Start by looking at the main theme download page on WordPress and compare it to Drupal's main theme download page.

Which one of those do you think looks more inviting to a designer trying to decide where they should spend their time, or a new user looking to develop their first site?





Hi, I'm Laurence and this is my Drupal blog.
Don't Make Me Think!
Pro Drupal Development
PHP Cookbook
Will You Please Be Quiet, Please?