Taxonomy. What is it and why should I use it in my Drupal site? In this blog post I will introduce you to the Taxonomy module.
By definition, taxonomy is the division of things into ordered groups or categories. In this use case, we have a site with many pages and I want to specify certain pages for students and other pages for faculty or staff.
Create a taxonomy vocabulary and terms
- Enable the Taxomony module.
- From Structure > Taxonomy > Add Vocabulary, create a new Taxonomy Vocabulary.
- Once your vocabulary is created, click add terms.
- Add a term and optional description. You have the option to Generate automatic URL alias which will give you a page of all the items tagged with this term. Then click Save. Repeat this step for each additional term.
Add taxonomy field to a content type
- Select a field type of Term reference and a widget of Check boxes/radio buttons or Select list. Autocomplete term widget (tagging) is used when you want to allow the user to add their own terms.
- Choose the Vocabulary to reference then click Save field settings. Set any additional settings then click Save settings.
Next time you create or edit that content type, you will have the option to categorize it with the term(s) you created. You can place the term ID URL in a menu and easily access content tagged with that term ID.
Going further with Taxonomy
In addition to seeing a taxonomy page for each term, you can use your taxonomy terms to control what shows up in a filtered view, but that's a tutorial for another day.