theming

Drupal Theming 101: Theme Developer Module

If you haven't already heard of it, the Theme Developer is a great tool. It works like firebug, but for Drupal. You can click any element on the page to inspect it, and the Theme Developer window will show you what template files and functions were used to render it, and give you suggestions on which files you can edit to affect it. For a newbie Drupal themer, this can be a god-send.

Drupal Theming 101: How to Remove System Stylesheets

When you first start creating a Drupal theme, you might be frustrated by the large number of stylesheets that are included by default in your theme -- especially if you're creating a Zen sub-theme. Most of the documentation suggests that you override these styles in your own themename.css file.

Repositioning node comments

A strange quirk in Drupal 6 hard-codes comment rendering into the node module. This makes it quite difficult to reposition comments, for instance under a set of tabs in the node template. Attempting this brings you crashing into the most dreaded rampart of Drupal theming; moving something out of it's vertical stack:
comments displayed as tab
comment_render($node) can easily be placed in your node template, but how on earth can the original display be removed? comment_render() is called by node_show(), which contains this nugget:

if (function_exists('comment_render') && $node->comment) {
  $output .= comment_render($node, $cid);
}

Ouch. (Thankfully, this has been fixed in Drupal 7.)

While it's tempting to fake it with jQuery, or CSS positioning, there is a way to fix this by overriding the page callback for node rendering. Here's a quick module that implements this solution:

Ready for transformation?