User login

Drupal Theming

Theming Drupal's user login block with CSS

Really, what is wanted is CSS

Here's a sample:

  #block-user-0 .form-item /* "User login form" block */
    margin-top: .5em;
    margin-bottom: .5em;

Drupal 6 theme from a module

Comment Module Example

Most of the time, the best way to learn is from looking at core. Randomly clicking around in a Drupal 6 download led us to modules/comment, where we noticed comment-folded.tpl.php. Aha! A template file with that name will probably not be called automatically by Drupal's template systems (as node.tpl.php might). So let's see just how comment.module handles this.

The _theme hook alerts Drupal to the presence of theming functions and, as in this case, a template:

How to configure nice menus

Installing and configuring Nice Menus:

Download or drush or otherwise acquire and get it into sites/all/modules. Enable at and no configuration is even necessary.

Image link rollovers for dynamic (user-uploaded) graphics with Drupal and CSS

The goal: a CSS-only rollover graphic that can also be a link that is uploaded by users.

Eliminating other options:

This could be done with JavaScript, but we and the W3C and everyone's sanity would much prefer a pure CSS solution.

Can you have inline styles with pseudo classes (namely, :hover?)


Add a span wrapper inside primary and secondary menu links in Drupal 6

This document takes us through the steps of figuring out how some output is produced (without an Integrated Development Environment with debugger) so that we can modify it. Skip straight to Agaric's answer in the resolution at the bottom if that's all you want!

theme_menu_item_link() has no effect on primary / secondary navigation links (at least when printed through the theme, and not as blocks). Which was unexpected.

However, in a Zen subtheme (called examplezen here) the following code produced all kinds of interesting output for node menus and

Building a Zen sub-theme: In shell commands

From the Zen documentation How to build your own sub-theme (6.x), translated into bash commands. The project is called example, and we have installed the zen theme to sites/default/themes.

Someone enterprising could make this into a simple bash script.

UPDATE: Someone did turn this into a bash script that was later incorporated into the docs. Here is a modified version of a more robust script that was posted to Jason Chinn's Magicsparks site:

Internet Explorer 6 appears to have PNG problems beyond its well-known transparency issues

IE6 has extremely weird PNG issues

Microsoft owes me another 4 hours of my life.

Just to let you know, apparently PNGs (without transparency, nothing to do with transparency on the page anywhere I was aware of, though there was a video and lots of other stuff), can simply fail to show up in the image tag. A completely normal img src style tag just doesn't display.

Using jpeg instead fixed it.

Panels2 and Organic Groups

So you want to use drupal's Organic Groups module and Panels2 because you've heard through the grapevine that really slick and useful things can be done with the combo..


Well, here's what one of the experts has to say about it -->

highly recommended and very useful...

do it!

Where in the theme are the tabs printed / giving tabs to admins only

On giving View, Edit, Revision, etc. tabs to administrators only.

In Drupal, tabs are not printed by the node, but by the page. On the one hand, since views and administrative pages and anything else you can think of can have tabs, this makes sense. But on the other hand every node can have

But in any case, if you're looking to change the presentation of tabs somehow (or as in our case, restore them to a theme design from which they had been removed), you will find the place to look is not node.tpl.php but page.tpl.php.

Drupal theming tip: theme_ functions you should NOT override

Theme functions are designed so that they can be overridden, but the building block theme functions provided by Drupal core should be left alone.

In discussion with a colleague, who provided all the insight paraphrased below, talking about some of the Drupal gotcha's we've seen get talented people not sufficiently indoctrinated into the Drupal way.

With one site, the designer overrode a ton of theme functions.

Like lists. So now menu_list is no longer an ordered list but a gathering of content

Syndicate content