Tagging Content Using Taxonomies
On this page:
What Are Taxonomies and How Would I Use Them?
Taxonomies offer a way to categorize, or tag your content. Users can click a tag to view all content which has been assigned that tag. Taxonomies can also be used to categorize blocks and views.
In Drupal, a tag name is called a term. Terms are grouped together into a vocabulary. These are the steps to setting up and using taxonomies:
- Select or create a new vocabulary
- Add your terms to the vocabulary
- Edit content types to include a field for vocabulary terms
- Select the appropriate term(s) for individual content
Vocabulary
You can use the default vocabulary or create a new one. You can create an unlimited number of vocabularies and add an unlimited number of terms.
To add a vocabulary:
- Click Structure, then Taxonomy.
- Click + Add vocabulary.
- Add a Name and Description.
- Click Save.
To delete a vocabulary:
- Click edit vocabulary.
- Click Delete twice to confirm.
Adding Terms
To begin adding terms to your new vocabulary click add terms.
Click the List Tab on the top right of the page. You have the option to edit terms, re-arrange the order or create sub-terms. Drag a term under and to the right to create a sub-term.
Adding a Field to Display a Term
There needs to be a place on a page where you can display the term you assign. This is called a "reference field" and you must edit each content type (e.g., basic page, blog) so the field is present. You do not need to assign terms to every page of that content type. You make the choice of terms, if any, on the actual page.
To add the field:
- Click Structure, then Content types.
- Click manage fields, for the desired content type, e.g., Basic page.
- Add a name in the Add new field box, e.g., Labels or Tags.
- Choose Term reference for field type.
- Choose a display widget, e.g., check boxes, a drop down select list, or autocomplete if you wish to add new terms on the fly.
- Click Save.
- Select the vocabulary to use with this content type.
- Click Save field settings.
- On this final settings page for your field, scroll down to Label Field Settings and set the number of values.
Applying a Term to a Page
You will now find your new field on any page overlay screen of the content type you just set up. Select which terms apply to that particular piece of content.
Using Terms to View Pages
Visitors to your site will see the applied term listed on the bottom left of your content.
Clicking the term will display other pages which also have that term applied. The content will be displayed in the teaser format which displays only a small portion of text. The teaser will show the name of the term in common at the top. A Read more link will show the full content.