6.6. Setting Up a Taxonomy

Last updated on
23 May 2017

Goal

Create an Ingredients vocabulary and add it to the Recipe content type as a field that can contain an unlimited number of values and that allows adding new terms to the vocabulary.

Site prerequisites

The Recipe content type must exist. See Section 6.1, “Adding a Content Type”.

Steps

  1. In the Manage administrative menu, navigate to Structure > Taxonomy (admin/structure/taxonomy). You will see the Tags vocabulary that was created with the core Standard installation profile.

    taxonomy list page

  2. Click Add vocabulary, and fill in the values below.

    Field name Explanation Example value

    Name

    The name of the vocabulary

    Ingredients

    Description

    A brief note about the vocabulary

    (Leave blank)

    taxonomy add Ingredients

  3. Click Save. You will be taken to the Ingredients page, which shows a list of all the terms in this vocabulary.

    Ingredients taxonomy term listing

  4. Click Add term. Enter "Butter" in the Name field. Click Save.

    Add term page

  5. You will receive a confirmation about the term you created. Add more terms. For example, "Eggs" and "Milk".
  6. In the Manage administrative menu, navigate to Structure > Content Types (admin/structure/types). Click Manage fields for your Recipe content type.
  7. Click Add field, and enter values from the table below. Click Save and continue.

    Field name Explanation Value

    Add a new field

    Select the field type

    Reference > Taxonomy term

    Label

    The title to give the field

    Ingredients

    Add Ingredients field to Content type Recipe

  8. On the following configuration screen, enter the values from the table below. Click Save field settings.

    Field name Explanation Value

    Type of item to reference

    The type of entity that is referenced by the field

    Taxonomy term

    Allowed number of values

    The number of values a user can enter

    Unlimited

    Field storage settings for Ingredients field

  9. On the following configuration screen, enter the values from the table below. Click Save settings.

    Field name Explanation Value

    Help text

    Help shown to users creating content

    Enter ingredients that site visitors might want to search for

    Reference type > Reference method

    Select the method used to choose allowed values

    Default

    Reference type > Available Vocabularies

    Select the vocabulary to choose allowed values from

    Ingredients

    Reference type > Create referenced entities if they don’t already exist

    Whether new ingredient terms can be created from the content editing form

    Checked

    reference type field settings

  10. Click Save settings. You will be taken back to the Manage Fields page. A message will be displayed saying that the configuration for Ingredients is complete.

    Manage fields page for Recipe content type

Attributions

Written and edited by Bob Snodgrass, and Jojy Alphonso at Red Crackle.

 

This page is generated from AsciiDoc source from the User Guide. To propose a change, edit the source and attach the file to a new issue in the User Guide project. PDF and e-book formats are available on the User Guide project page.

Source file: structure-taxonomy-setup.txt