Taxonomy in Drupal

The taxonomy module is a very useful utility for Drupal sites, especially for those of any size. Primarily summarised from the Drupal Handbook on the subject, the following gives a basic summary of the subject.

Taxonomy is a core-optional module is required for another core-optional module, Forums. This is because a Forum requires categorisation for subject matter! To enable Taxonomy simply go to admin/build/modules and enable. To build a vocabulary or establish terms go to admin/content/taxonomy. There is a great tutorial already written for this administrative functions. This post will concentrate more on the conceptual and management side.

A taxonomy allows users to add terms (also known as tags, metadata, categories etc) to content. A taxonomy for a site contains one or more vocabularies and each vocabulary contains a set of terms.

A "Taxonomy Vocabulary" classifying music by genre with terms and sub-terms. For example (from the Drupal Structure Guide)

Vocabulary = Music
term = classical
sub-term = concertos
sub-term = sonatas
sub-term = symphonies
term = jazz
sub-term = swing
sub-term = fusion
term = rock
sub-term = soft rock
sub-term = hard rock

The Taxonomy module allows a vocabulary to be set up with either user defined tags (also known as "folksonomy") or administrator defined terms, or "controlled vocabulary".

The following principles apply to defining a vocabulary

* Each vocabulary consists of a set of terms (keep it down to about 30-40, unless using a well-known list e.g., countries of the world).
* A site can have an unlimited number of vocabularies each containing an unlimited number of terms.
* Within a vocabulary terms are ordered into hierarchies.
* Vocabularies can be set to allow terms to define related terms.
* Vocabularies define whether users may attach only a single term to a node or whether users may attach multiple terms to a node.

By using multiple vocabularies it is possible to classify an individual node in multiple ways.

When creating terms the following options are provided:

* Term name (Required) - The name for this term.
* Description (Optional) - Description of the term, used by some modules and feeds.
* Parent (Required) - The term under which this term is a subset; required when heirarchy is enabled for the vocabulary.
* Synonyms (Optional) - Enter synonyms for this term, one synonym per line. Synonyms can be used for variant spellings, acronyms, and other terms that have the same meaning as the added term, but which are not explicitly listed in this thesaurus.
* Weight (Optional) - The weight is used to sort the terms of this vocabulary.

Hierarchies allow the creation of sophisticated taxonomies with categories and subcategories in a tree structure, much like Yahoo categories or subject classifications used by libraries. Categories can have multiple parents (for example, 'milk' is both 'dairy' and 'drink' in the 'food' vocabulary).

When users view a post to which a term has been assigned, along with the post, many themes will generally display the node's term(s). Each term appears as a link which, if followed, displays a page showing the other posts with the same term. The menus on your site can call for items that match specific taxonomy terms.