Taxonomy

Last modified: October 24, 2008 - 00:32

The taxonomy module allows you to categorize your Drupal content. It is very flexible and allows you to use the classification scheme that is most suitable for your site. The terms that you use can be specified by an administrator, they can be applied ad hoc by users (free tagging) or they can be a combination of both free tagging and administrator-selected terms.

Understanding Taxonomy

According to Wikipedia, taxonomy is the "practice and science of classification". In Drupal, taxonomies are comprised of vocabularies and terms. Essentially, a vocabulary is a container for terms. So you first create a vocabulary, and then you can create the terms that populate the vocabulary. For example, in the vocabulary "Countries", the terms might be "Belgium", "United States", "Canada" etc.

Terms can also be nested, so a vocabulary called "Regions" might have terms for "North America" and "Europe". Nested under those terms could be "United States" and "Germany" respectively, and then you could continue on into cities etc.

Visually, that would look something like this:

Vocabulary: Regions

  • North America
    • Canada
    • United States
      • Florida
  • Europe
    • Germany
    • United Kingdom

etc.

An alternative option when creating a vocabulary is to enable the option for "Tags" (often referred to as "free tagging"), as seen in many social bookmarking and networking sites. When the Tags option is enabled, the users of your site can provide the terms (tags) when they submit the content.

You can add as many vocabularies and terms as you wish to your site. There are many contributed modules which then allow you to add navigation based on taxonomy such as menu items or tag clouds. You can also configure your site so that clicking on a taxonomy term in one article can navigate the user to a list of all the articles that use that term. Any time you are thinking about categorizing the content on your site, it is very likely that there is a way you can use taxonomy to do so.

Administering Taxonomies

These are some of the configuration options available from the Taxonomy section of the Administration menu.

  • To associate a vocabulary with a specific content type, enable the option next to the content type. Terms from the vocabulary will be available when creating or editing content of the selected type. Multiple vocabularies tied to the same content type will be displayed in the order shown.
  • To change the order of a vocabulary, drag a handle under the Name column to a new location in the list. (To drag a handle, click and hold the mouse button while hovering over a handle icon.) Your changes will not be saved until you click the Save button at the bottom of the page.
  • To allow the application of more than one term from the vocabulary, enable the "Multiple Select" option.
  • To force the use of a vocabulary, enable the "Required" option. When this option is enabled, content can not be created without specifying at least one term from this vocabulary
 
 

Drupal is a registered trademark of Dries Buytaert.