Categories (Taxonomy)

You will see a lot of posts on the Drupal site about creating and using a Taxonomy (or "vocabulary" and "terms"). Most of those posts will be over your head - many are still way over my head.

While it is true that the more content you have the more obvious the need for a taxonomy becomes, there is certainly no reason why a smaller website that has things to classify can't use it.

For example, I run a web site for a group that has members submit articles for a monthly newsletter. They wanted a way to organize it so that they could go back and review it by date or topic. So I created two vocabularies, one for the issue date and one for the topic. Now they can, with one click, read all the book reports, movie reviews, or humorous articles. And, every month when they submit new articles, they automatically show up in those lists. Another use is to categorize collections of FAQs, which I do on another site. They had, at the time I set it up, three hard-coded HTML pages with different types of FAQs; no one wanted to touch them. I installed the FAQ module (which is great), and set up the three terms in a single vocabulary. That allowed them to actually grow their FAQ library to now contain six categories, and it is trivial for them to maintain it.

But to try to help you get a slightly better idea of how to use them, I'll use a case study here.

The Recipe module is probably a good example. On one of my sites, in order to foster a bit more "community" feel and encourage visits to my site, I decided to add a group cookbook (a real one, not like this book). The recipe module does that.

It didn't take me very long to realize that entering a bunch of recipes without any organization would get messy pretty quick. Well, recipes fall into several categories: Appetizers, Entrées, Desserts, etc. So let's set up those things as a "vocabulary" with which we can organize the recipes.

  1. Go to Administer>>Content management>>Categories and click on the "Add vocabulary" tab.
  2. Enter the name, for example "Recipes." Then a "Description" like "Our community cookbook."
  3. Select the type of content this applies to. The Recipe module introduces a "recipe" type.
  4. I selected a "single" hierarchy. Later on, if the number of contributions gets large, I can always add sub-categories (like "Beef," "Poultry," and "Pork") and change to multiple level hierarchy.
  5. I then selected "Required" to force the users to choose a category for any recipe they enter.

That's it for the "vocabulary," so click on the "Submit" button. You'll go back to the Categories list. You should see your new vocabulary listed.

Towards the right, you'll see a link to "add terms." Click on it.

  1. Since this is a single level hierarchy, the "Parent" should say "<root>."
  2. In "Term name" enter your first term, such as "Appetizers."
  3. Enter a "Description" such as "Things for before the meal."
  4. Don't worry about the rest yet, just click the "Submit" button.
  5. Keep adding the rest of your terms ("Salads," "Soups," "Side dishes," etc.

Now when a user goes to Create content and selects "Recipe," they will be required to choose one of these categories for it. And if they go to the "Cookbook" menu item they'll see a list of categories that they can browse.

That wasn't as complicated as all those posts sound like, was it?

For another example, I run a web site for a group that has members submit articles for a monthly newsletter. They wanted a way to organize it so that they could go back and review it by date or topic. So I created two vocabularies, one for the issue date and one for the topic. Now they can, with one click, read all the book reports, movie reviews, or humorous articles. And, every month when they submit new articles, they automatically show up in those lists. [By the way this was done with a custom content module that is easily adapted to other uses. It is available through me.]

Another use is to categorize collections of FAQs, which I do on another site. They had, at the time I set it up, three hard-coded HTML pages with different types of FAQs; no one wanted to touch them. I installed the FAQ module (which is great), and set up the three terms in a single vocabulary. That allowed them to actually grow their FAQ library to now contain six categories, and it is trivial for them to maintain it.


Some newbies swear by these articles: Drupal and the New Paradigm and The Power of Drupal Categories

Comments

Tagging

Hi, I wondered if you know how to tag content where some tags are visible, and some are hidden. I want to be able to organize the content but do not to overwhelm the visitor tags I consider "internal" to my ideas of how it should be organized.
David

Altering Taxonomy Tag Display

To change some taxonomy links, you need to have a module that use the hook_link_alter technique. You would scan through them and hide the ones you don't want shown. I'd love to see another field added to category terms that say "Show/Hide this term."