Skip to Navigation

Taxonomies and Drupal: When Do Hierarchies Make Sense?

Printer-friendly version

One of Drupal's strengths is in the ability of the Taxonomy module to handle hierachical categories. It makes lists like this easy:

  • Fruit
    • Apples
    • Bananas
    • Oranges
  • Vegetables
    • Celery
    • Lettuce
    • Broccoli

This enables people to browse all the items you have marked as Apples, Bananas, or Oranges by simply clicking on the Fruit taxonomy term. But not everybody adding content to your site is a catalog librarian, and that can get you into trouble. Consider the following list for a hypothetical organization concerned with courtroom procedure:

  • Judges
  • Jurors
  • Bailiffs
  • Court Reporters
  • Attorneys
    • Defense
    • Prosecutors

It's logically correct, as all Prosecutors are Attorneys. But consider the average user. Do they think of prosecutors that way? If your audience is the general public, they'll see the top level of that list and wonder where prosecutors are. Worse, what if someone categorizes some content with just Attorneys? This is perfectly possible to do in Drupal, and it's useful if you have items that don't fall into a subcategory. But here there are no other choices, so it would confuse anyone looking at one of the subcategories if an item wasn't there because someone didn't get specific enough when classifying it.

You could, of course, write some complicated form element with JavaScript to prevent anyone from using the parent classification. Although, that would eat up time and still leave you with a strange list.

The easiest solution is to simply move Defense and Prosecutors up to the top level. But if part of the organization's mission is to distinguish lawyers from other courtroom personnel, you could get around it this way:

  • Judges
  • Jurors
  • Bailiffs
  • Court Reporters
  • Attorneys: Defense
  • Attorneys: Prosecutors

You have the hierarchy stressed without incurring the complexities of actually using a hierarchical taxonomy.

Remember: hierarchies are very expressive, allowing you to communicate to the rest of the world exactly how you classify things. But the way you classify things and the way other people understand them can be different, and simple lists are easier to scan. So remember that these are just tools, and just because your categories have levels doesn't mean you always must use a hierarchy.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.