I recently came across a challenging theming problem in Drupal involving hierarchical taxonomy vocabularies. Drupal, in general, doesn’t handle taxonomy hierarchies very well. You can easily put taxonomy terms into hierarchies, but it’s difficult to do anything with that information afterwards (e.g. treat parent and child terms differently in some way, or identify where the term is in the hierarchy).
In my case, I needed to use a different page layout for taxonomy term pages depending on whether they were a parent or child term. Category (top-level) taxonomy landing pages needed to display a feature image and headline (fields in the taxonomy vocabulary) and a list of manually selected content (using Nodequeue). Sub-category (child-level) taxonomy landing pages needed to show a description (another field in the vocabulary) and all nodes associated with that term.
Top-level (parent) term display
Child-level term display
If you’ve attempted to add color module support to your Drupal theme, you’ve probably found the methods to be confusing, to say the least. I don’t understand this well enough to write a full tutorial, but I can offer a few tips:
- There are two main tasks in implementing the Color module: getting the preview in the theme settings to work and then getting those colours to apply on the actual site. Implementation instructions tend not to differentiate between the two, which adds to the confusion.
- You must have colour options called “text” and “links”. (see issue #693504 for some background on this). That issue seems to indicate that “base” is required as well but I haven’t found that to be the case. This means that you must have at least two optional colours in your theme (and probably three if you want to do more than just text and links!).
- There are two methods for implementing the preview in the theme settings. One is the (incredibly confusing) sliced image method described in the Drupal.org documentation, and used in the Garland theme. The other uses a rough html/css mock-up instead of images, as demonstrated in Bartik. I chose the latter.
- If you don’t want to use the gradient option in your theme, you have to leave the array empty in your color.inc, otherwise you get PHP errors. Just like this:
'gradients' => array(),
- If you’re getting PHP errors about an “Undefined index”, it may be because of either point 2 or point 4, above.
I have found the Adding color module support to your theme in Drupal 7 tutorial by James Tombs to be particularly helpful. It describes the html/css method implemented in Bartik.
In my last post I offered a critique of the (not-so) new University of Waterloo home page. The next question is, how do these things happen?
Before I get started, I’d like to be clear that the points offered up in this post are gross generalizations, and certainly wouldn’t apply to all universities. These are just some of the issues I experienced at Waterloo—there are others that I won’t go into. I’m sure people who work at UW or other universities can think of additional factors to add. These points are also referencing the home page, although most of the factors listed apply to the rest of the web space as well.
Those of you who are familiar with web design in higher ed have surely seen the infamous venn diagram cartoon from xkcd:
When this was originally posted I remember seeing some talk about “web managers” not understanding usability. At least in my experience (as a former university web manager), that’s not the case at all. There are several problems at the root of this: Read more…