Beginning Drupal 8
Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015
Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 4 ■ Taxonomy<br />
“individual sports.” Under team sports you might see football, basketball, baseball, hockey, volleyball, and<br />
other team sports. Under individual sports, you might see golf, swimming, track and field, and motor sports.<br />
You could continue to build out the hierarchy of sports until you have a representation of every sport on the<br />
planet. As an author writing an article about a sporting event, I could choose one or more predefined terms<br />
to categorize my article.<br />
A big benefit of structured taxonomy over simplified tagging is the ability to select articles by individual<br />
terms, or by categories of terms. In the previous example, you could look for articles specifically about<br />
football, or you could take a more generalized approach and look for all articles within the category of<br />
team sports.<br />
Determining whether to use tagging or structured taxonomy is a matter of deciding how ridged you<br />
want the categorization of content to appear on your site. And the great news is that you can use both<br />
approaches simultaneously to provide authors with a high level of flexibility.<br />
Let’s take a look at a real-world example. Let’s say we are creating a website that is focused on sports<br />
news. Our targeted audience is people who like to follow what is happening with their favorite teams. If we<br />
think about how people might want to search and navigate content on our site, we might think of organizing<br />
the content by the type of sport, for example:<br />
• Football<br />
• Baseball<br />
• Basketball<br />
• Hockey<br />
• Soccer<br />
People may also want to find sports news by team:<br />
• Ravens<br />
• Trailblazers<br />
• Lakers<br />
• Raiders<br />
• Yankees<br />
In this example we would follow our previous example and create a structured taxonomy. We would<br />
first create a vocabulary, which is the highest level in a hierarchical structure. For this example we would<br />
create a vocabulary called “type of sport.” The terms that we would create within that vocabulary are<br />
football, baseball, basketball, hockey, and soccer. We would then create a second level in our hierarchy<br />
where we assign the terms for the team names; for example, beneath the term football we would assign the<br />
terms Ravens and Raiders. Beneath the term basketball we would assign the terms Trailblazers and Lakers.<br />
Beneath the baseball term we would assign the term Yankees. We could continue adding team names until<br />
every team in every sport is assigned to their appropriate spot. For the purposes of our demonstration, we’ll<br />
stick with the simplified list.<br />
Creating Vocabularies<br />
The first step in using taxonomy is to identify and create the vocabularies that you will use to categorize<br />
content on your website. Depending on the focus of your site and the breadth of subjects that you cover,<br />
you may only need a single vocabulary or you may need several vocabularies. There isn’t a “correct” answer,<br />
nor is there a formula that you can use to determine how many vocabularies your site will need. The best<br />
36