Site Building
Topic

Taxonomy for Drupal 7, 8, 9, and 10

Taxonomy provide a way to classify your site’s content. Taxonomy vocabularies are created with terms within those vocabularies. Then reference fields can be added to content types or other entity bundles so that content can be individually categorized.

For example, on the Drupalize.Me website, we have a vocabulary called Categories with terms for each category of content we have, i.e., Site Building, Theming, Module Development, Site Administration, and Backend and Infrastructure. We then add a reference field on each content type, like blog and tutorials. This enables us to “tag” each blog post or tutorial with the appropriate category.

Example tasks

  • Set up a taxonomy to categorize your site’s content
  • Access taxonomy entity data in a module

Confidence

The process of using Drupal’s administrative UI to create vocabularies, terms, adding taxonomy fields, and tagging content with taxonomy terms is essentially the same process in Drupal 7 as in Drupal 8. However, the developer experience of accessing taxonomy-related data in a module has changed due to Drupal’s object-oriented architecture and also its emphasis on practically everything being an “entity.” Thus, instead of taxonomy-specific functions, taxonomy data is accessed programmatically via the Entity API. See the Entity topic for more information.

Drupalize.Me resources

Drupal 8, 9, 10, and 11
More information

Overview of reference fields and their commonly-used types.

Drupal 8, 9, 10, and 11
More information

Overview of taxonomy and how it can be used to categorize content in a website.

Drupal 8, 9, 10, and 11
More information

How to create a taxonomy vocabulary and add it as a field to a content type.

Drupal 8, 9, 10, and 11
More information

How to add a reference field that connects two content types.

More information

Content modeling consists of identifying and constructing the different building blocks of data that compose the information on your site.

For developers

Taxonomy uses Drupal’s Entity API.

Drupal 7

Categories
Drupal 7
More information

In this chapter we talk about Drupal's taxonomy system, which is a way to organize our content. We'll walk through the steps to create a new vocabulary, add some terms, and then use it with our Press Release content type.

Guides

Not sure where to start? Our guides provide useful learning tracks for all skill levels.

Navigate guides

External resources