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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4 ■ Taxonomy<br />

approach is to think about the content that you will include and the subjects that the content will cover.<br />

If the subjects are all related (for example, types of sports), then a single vocabulary is likely all that you will<br />

need. If the subjects are not related (for example, a book-related website where books may be categorized by<br />

author, subject, publisher, and targeted audience), then the use of several vocabularies may be necessary.<br />

It’s up to you, the site creator, to define the structure that best suits the purpose of your site, how you want<br />

content structured, and how you want visitors to access that content.<br />

Once you’ve identified at least one vocabulary, click the Manage link in the admin menu at the top<br />

of any page on your site and then click the Structure link. You’ll see a list of options that includes a link to<br />

Taxonomy. Click that to reveal a page that lists all of the vocabularies that have already been defined for<br />

your site. By default, <strong>Drupal</strong> creates a vocabulary called Tags as a default generic “container” for terms.<br />

See Figure 4-1.<br />

Figure 4-1. The Tags vocabulary<br />

To add a new vocabulary, click the “Add vocabulary” link at the top of the list, revealing the form shown<br />

in Figure 4-2. In the Name field, enter “Type of Sport,” and enter a brief description in the Description field.<br />

The Description field is an optional field and by default is not displayed on the administrative interface for<br />

taxonomy. However, you may want to use this field when rendering lists of content as a description about the<br />

content that is contained in the list.<br />

Figure 4-2. Creating a new vocabulary<br />

Once you’ve entered values in both fields, click Save. <strong>Drupal</strong> then displays the list of terms associated<br />

with your vocabulary. Since this is a new vocabulary, the list is empty. See Figure 4-3.<br />

37

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

Saved successfully!

Ooh no, something went wrong!