From the course: Drupal 9 Essential Training: 3 Taxonomy, Media, and Modules

Taxonomy explained - Drupal Tutorial

From the course: Drupal 9 Essential Training: 3 Taxonomy, Media, and Modules

Start my 1-month free trial

Taxonomy explained

- [Instructor] I've been using Drupal since Drupal 5. Though I skipped Drupal 6 'cause I wasn't much of a fan, Drupal 7 came along in January 2011, and I was hooked again. But in all that time, I struggled to understand taxonomies. I don't know why, I just had a thing. So I bought a book. It cost $99. Let me save you $99. Are you ready? Taxonomy is categories. That's all it is. In Drupal, if you want to categorize your content, well, the best way to do it is by using taxonomies, and here's why. Taxonomies relate content together. They can create groups for list displays, provide an RSS feed per term. Taxonomies are unbelievably flexible in Drupal 9 because as an entity, of course, you can add fields to a taxonomy term, like a media field. So, an image or a video and more, and we'll do that in upcoming exercises. So, with Drupal, there is a default taxonomy, and it's the tagging system in the article content type. These are user defined, and they're great for tagging blogs. But I can't encourage you enough. If you're building an enterprise site or a site that other content editors will use, I strongly recommend that you do not use the tagging system, but that you create what I call a closed taxonomy. A closed taxonomy is one where you as the site builder define all of the terms or categories that an editor can choose from, and then they get to choose from them. They don't get to add their own. And there's a solid reason for this, because it's just so easy to add new tags, including typos, and it can become a real mess. So taxonomy's are made up of two parts, vocabularies and terms. The vocabulary is the main category. So in this case, we're going to categorize our businesses on our site. And the terms for our vocabulary in the business category taxonomy are Training, Site Building, Theming, Module Development and Migrations. Similarly, we might have an events vocabulary for our event content type. And these terms or categories might be, might be After Hour Party, Drupal Picnic, DrupalCamp, DrupalCon, Training and more. Whenever you use a taxonomy to correctly categorize your content, well then, creating landing pages is done automatically for you, and you can style those with Layout Builder. Filtering your views or your landing pages, because you're used taxonomy again, is really simple. Even creating a block with related content, in this case, OSTraining is in the training category, and so are these businesses. We'll show you how to do that. So taxonomy is much more than just a dropdown when it comes to categorizing your content. And I can't encourage you enough to really check this out. In the upcoming exercises, we're going to make great use of taxonomies to categorize all of our content.

Contents