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<br />
Taxonomy<br />
One of the <strong>Drupal</strong> features new <strong>Drupal</strong> users underuse and misunderstand is taxonomy. New <strong>Drupal</strong> users<br />
are overwhelmed with all of the other features and functions provided by the platform, and they bypass what<br />
may be one of the most powerful and useful features that <strong>Drupal</strong> has to offer. In this chapter you will create<br />
and use taxonomy terms to categorize content so that visitors can easily find information related to a<br />
specific topic.<br />
Taxonomy Overview<br />
While many of us may not be able to define the word “taxonomy,” the reality is that we use taxonomy on a<br />
daily basis as a means for categorizing “things” in our lives. If you open the doors to your kitchen pantry,<br />
you might find an orderly assemblage of food items: all of your spices on the top shelf, canned food on the<br />
second shelf, pastas and other boxed foods on the third shelf, and cereal boxes on the fourth. Categorizing<br />
your food items and putting things away in an orderly fashion so that you can easily find food items when<br />
you need them to prepare a meal is in its simplest form the use of taxonomy. Without this “kitchen taxonomy<br />
system,” you may have everything you need to make dinner jammed randomly in the pantry, but finding it<br />
may be a challenge, leading to frustration and a phone call to the local pizza delivery restaurant when you’re<br />
not able to find the ingredients you need to make a meal.<br />
In <strong>Drupal</strong>, taxonomy is divided into two general capabilities: tagging and structured taxonomy. Both are<br />
powerful solutions and can be used simultaneously on your site. Tagging is a simplified yet powerful use of<br />
the taxonomy system, enabling content authors to enter keywords that describe the content in a text field on<br />
the content editing form. As an example of tagging content, an author who writes an article about alternative<br />
energy could use keywords, or tags, such as “solar,” “wind,” and “geothermal” to categorize the article. The<br />
keywords created by the author are typically displayed as hyperlinks at the end of the article and can be used<br />
by site visitors to locate other content tagged with the same keywords.<br />
Tagging is freeform, meaning it’s up to the author to define what words they want to use to classify their<br />
content. A common issue with using tagging as an approach to categorize content is that different people<br />
use different words to refer to the same concept. For example, an article about rain might be tagged with the<br />
word “rain” by one author, “precipitation” by another author, and “drizzle” by a third. Site visitors trying to<br />
find articles about the general concept of rain would have a difficult time finding the ones tagged with words<br />
other than “rain.” Another common problem is misspellings. If an author tags an article about rain with<br />
“reign,” then site visitors are going to have a hard time, using taxonomy, to find that article using the<br />
word “rain.”<br />
The second approach for using taxonomy to categorize content in <strong>Drupal</strong> is structured taxonomy. In<br />
this approach, a site administrator creates all the words that can be used to categorize content, and content<br />
authors simply select from the list of words to categorize their content. A benefit of structured taxonomy<br />
is that it can be hierarchical, meaning terms may be put into groups to categorize content. An example<br />
of a hierarchy could be taxonomy for sports. The first level of terms could be “team sports” and<br />
35