Last updated November 21, 2010. Created by pcorbett on January 25, 2006.
Edited by figaro, porg, waztech_steve, drupalshrek. Log in to edit this page.
Drupal's Taxonomy is about organizing your site by attaching descriptive terms to each piece of content. Those terms might describe what section of your site a particular page belongs to, or what topics are discussed in a given blog post, or what region of the country a photograph was taken in. These terms are organized in separate 'Vocabularies' so for example that recipe ingredients don't get mixed up with cities in Texas when you're trying to find out what travel-logs were written in Houston, or what soups use potatoes.
Setting up these Vocabularies, and the descriptive terms that belong to them, is the first step in organizing your Drupal site. There are different kinds of vocabularies, and understanding how they differ can help you decide the best way to categorize your content.
- Lists of pre-defined terms -- a 'flat' vocabulary, i.e. colors: red, blue, green.
- Hierarchies of pre-defined terms -- a 'tree' vocabulary, i.e. Location: United States-Illinois, Europe-France.
- User created terms -- a 'free-tagging' vocabulary, created when content is created.
For example, let's say you're setting up a photo portfolio and using Taxonomy to keep things organized.
Create a 'flat' vocabulary
First, you might create a 'flat' vocabulary for basic organization called 'Photo Type'. To that vocabulary, you would add the terms 'Portrait', 'Stop-Action', 'Landscape', and so on.
Create a 'hierarchical' vocabulary
Next, to keep track of where the photographs were taken, you might create a hierarchial vocabulary called 'Location'. To it, you could add terms like 'Europe' and 'United States'. In a hierarchial vocabulary, each of those terms can also have sub-terms like 'France' and 'Illinois'. This makes it possible to tag a photo once with the term 'London' and retrieve it later with a broader request like 'Show me all the photos taken in Great Britain'.
Create a 'free tagging' vocabulary
Finally, to capture notes about each photograph that would be hard to plan in advance, you could add a 'free tagging' vocabulary called 'Keywords'. Rather than defining the terms in advance, a free tagging vocabulary lets you enter in new terms each time you post a piece of content. If two separate content items use the same vocabulary term, they will both show up when that vocab term is searched or accessed from a menu block.
With those three vocabularies in place, any new photograph you post to your site can be quickly categorized. Whenever you post a new image, Drupal offers you a list of the available terms in the 'Photo Type' and 'Location' vocabularies AND a place to type in terms for your 'Keywords' vocabulary. When posting a photo of your brother's wedding, you might select a Photo Type of 'Portrait', a Location of 'Paris' and type in 'wedding' and 'brother' as keywords.
If you're used to other CMS or blogging systems, these different vocabulary types might be refered to as 'categories' or 'sections' or 'keywords'. It's important to note that Drupal does not require you to use these vocabularies
Also note that different kinds of content can use different vocabularies when it makes sense. For example, News articles and Images might share 'Keywords', but 'Photo Type' obviously only makes sense for one.
Mixing and matching these techniques in Drupal allows you to create the organizational system that best suits your needs. Getting used to it can be tricky at first, but if you take the time to think through your site's organization, the results are worth it.
Comments
view of the vocs
Very clear. Even for a Drupal newbie ;-) I have a news content with three vocs but I hate the way it looks on screen. On editing I get these listings *vertically* (I would love to have them on one horizontal space) and on reading the news aricle I have three seperate lines of keywords beneath the article. Again, I would love to have these tems on *one* line even if they come from different vocabularies. I have no idea if and how this can be done. Reading pointers?