18.11.2015 Views

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

SHOW MORE
SHOW LESS

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 />

If you happen to forget to select a parent term before saving, you can always position a term by<br />

clicking the arrows icon, holding the button down and dragging it to the position in the hierarchy where it<br />

should reside. You may also assign the term to the appropriate parent term by clicking the Edit button and<br />

modifying the value in the Relations section.<br />

We now have the ability to assign taxonomy terms to content items at the child level as well as at the<br />

parent level.<br />

The resulting web page that is created using this method now shows the associated sport as “High<br />

School.” Clicking High School would render a list of all pages that are associated with the term “High School.”<br />

Using views, which are described in detail in Chapter 5, provides you with the additional capability of listing<br />

all content within the hierarchy—for example, all articles categorized as Basketball, regardless of whether<br />

they pertain to high school, college, or NBA.<br />

Assigning More Than One Vocabulary<br />

There may come a time when categorizing content by a single vocabulary represents a constraint that you<br />

must overcome to address a complex requirement for content categorization. Fortunately, <strong>Drupal</strong> does<br />

not constrain you as to how many vocabularies you can assign to a content type. Simply follow the steps<br />

you performed earlier in this chapter to add a second field to the content type. Simply select a different<br />

vocabulary as the source for the values that you wish to present to the author.<br />

Summary<br />

This chapter introduced the power and simplicity of taxonomy. I suggest that you start using taxonomy<br />

on your first site, because the more you use it, the more comfortable you will be with its capabilities and<br />

the power that it brings to the content you deliver to your visitors. I will continue to leverage taxonomy<br />

throughout the rest of this book as I cover other advanced <strong>Drupal</strong> features.<br />

46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!