School is a twelve-year jail sentence where bad habits are the only curriculum truly learned.
John Taylor Gatto
No doubt about it, moving from Drupal 5 to 6 is a good idea, sites run faster, the API is solid and the code clearer to understand.
But one of the things that took me more time to understand were the changes related to creating themes with Drupal 6.
These days I've been upgrading a couple of sites to Drupal 6 and have found a few important details that may save you some time:
- You can use templates (tpl.php files) or theme_ functions but the documentation recommends using templates. Even if theme_ functions run faster templates are easier for non programmers.
- Now each module can, and should, include its own templates. These can be overriden by a theme just by including a file with the same name as the original template in the theme directory.
- Each module must use hook_theme to register the templates or theme_ functions that it will use. I was getting blank pages from some theme_ functions in a Drupal 5 module I was upgrading and the cause was I did not have a hook_theme in the module.
- Most changes in hook_theme require clearing the cache at /admin/settings/performance.
- All your business logic should be in preprocess functions that create or modify variables to be included in the templates.
That's it. What can you add? Tell us about your experience creating Drupal 6 themes.
Posted to Drupal on Fri, 2009-01-23 20:18
Also visit
Other Resources
www.flickr.com
This is a Flickr badge showing public photos and videos from alexisbellido. Make your own badge here.

Recent comments
14 weeks 6 days ago
15 weeks 7 hours ago
15 weeks 3 days ago
15 weeks 3 days ago
19 weeks 3 days ago
19 weeks 3 days ago
25 weeks 4 days ago
26 weeks 4 days ago
28 weeks 3 days ago
32 weeks 3 days ago