Drupal
Drupal Theming Links On Drupal.Org
A couple of days ago I was contacted by a reader asking if I could provide them with links to some other sites like My Drupal Blog. Well, whilst I subscribe to a couple of Drupal related blogs I usually just keep an eye on Planet Drupal for all the latest goings-on.
However, there is also a lot of great theming stuff to be had on drupal.org itself, although sometimes trying to find that stuff can be a little unwieldy.
So, the following is an attempt to bring together a list of links to Drupal theming resources specifically on drupal.org. There are obviously thousands of forum pages relating to specific theming issues, so this list is meant as a general overview of the more major Drupal theming pages on drupal.org. If you have any other suggestions be sure to add them in the comments, and I'll append the list as necessary.
Drupal.org (general)
- Theme guide (Drupal 6)
- Theme guide (Drupal 5 and earlier)
- Main themes page
- PHPTemplate theme engine
- Theme snippets
- Theme development forum
- All the new Drupal theme releases
- RSS feed of all the new Drupal theme releases
- Theme and modules used on drupal.org
- Videos and slides (master list)
- Theming videos
- Drupal API
- Drupal API themable functions / theme implementations
- Theming your views
- Mailing list main page
- Themes mailing list
- IRC overview
- #drupal-themes - IRC channel for theme support (see the IRC overview link above for more details)
Drupal.org (groups)
My Drupal Blog Is One Year Old
Well, it seems I was so busy with the redesign launch and sorting out Kupo that I clean forgot My Drupal Blog has just turned one - aaahh.
I want to say a massive thanks to everyone for reading, commenting on, and linking to the blog - it has been great to write about, and get your feedback on, all things Drupal theming over this past year.
To give you a few stats about the blog:
- My first post, entitled Introduction, was published on May 9th 2007 and got nine comments.
- In total, I've written 40 posts and received 219 comments.
- The blog currently has 141 subscribers to the main posts, and 18 subscribers to the comments.
- The most popular blog post, rated by number of comments, has been Drupal 5.1 + PNG + IE6.
- The most popular blog post, rated by number of views, has been Theming The Search Submit Button - A CSS Cross-Browser Compatible Solution.
- The busiest day was on April 9th 2008, the day I posted Classes For (Almost) Everything In A Drupal Theme
Anyway, thanks again and I look forward to the next year :)
Laurence.
Testing Needed For New Drupal Theme 'Kupo'
I will soon (hopefully within the next 2-4 weeks) be releasing Kupo. This will be my first publicly available Drupal theme via drupal.org.
I know that testing of Drupal themes and modules is generally an iterative process which happens once the theme or module is available for download, but thought that it made sense to catch any blatantly obvious problems before an initial release.
So, please feel free to click around the new theme and let me know what you think and/or find.
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!
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 ;)





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?