[[structure-taxonomy-setup]]

=== Setting Up a Taxonomy

[role="summary"]
How to create a taxonomy vocabulary and add it as a field to a content type.

(((Taxonomy,creating)))
(((Vocabulary,creating)))
(((Metadata,creating)))
(((Term list,creating)))

==== 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.

==== Prerequisite knowledge

* <<planning-data-types>>
* <<structure-taxonomy>>
* <<structure-fields>>

==== Site prerequisites

The Recipe content type must exist. See <<structure-content-type>>.

==== Steps

. 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. (Note that the name and
description of this vocabulary are shown in English on this page; see
<<language-concept>> for an explanation.)
+
--
// Taxonomy list page (admin/structure/taxonomy).
image:images/structure-taxonomy-setup-taxonomy-page.png["taxonomy list page",width="100%"]
--

. Click _Add vocabulary_, and fill in the values below.
+
[width="100%",frame="topbot",options="header"]
|================================
| Field name | Explanation | Example value
| Name | The name of the vocabulary | Ingredients
| Description | A brief note about the vocabulary | (Leave blank)
|================================
+
--
// Add Ingredients vocabulary from admin/structure/taxonomy/add.
image:images/structure-taxonomy-setup-add-vocabulary.png["taxonomy add Ingredients",width="100%"]
--

. Click _Save_. You will be taken to the Ingredients page, which shows a list
of all the terms in this vocabulary.
+
--
// Ingredients vocabulary page
// (admin/structure/taxonomy/manage/ingredients/overview).
image:images/structure-taxonomy-setup-vocabulary-overview.png["Ingredients taxonomy term listing",width="100%"]
--

. Click _Add term_. Enter "Butter" in the _Name_ field. Click _Save_.
+
--
// Name portion of Add term page
// (admin/structure/taxonomy/manage/ingredients/add).
image:images/structure-taxonomy-setup-add-term.png["Add term page",width="100%"]
--

. You will receive a confirmation about the term you created. Add more
terms. For example, "Eggs" and "Milk".

. In the _Manage_ administrative menu, navigate to _Structure_ > _Content Types_
(_admin/structure/types_). Click _Manage fields_ for your Recipe content type.

. Click _Add field_, and enter values from the table below. Click _Save and
continue_.
+
[width="100%",frame="topbot",options="header"]
|================================
|Field name | Explanation | Value
| Add a new field | Select the field type | Reference > Taxonomy term
| Label | The title to give the field | Ingredients
|================================
+
--
// Add field page to add Ingredients taxonomy reference field.
image:images/structure-taxonomy-setup-add-field.png["Add Ingredients field to Content type Recipe"]
--

. On the following configuration screen, enter the values from the table below.
Click _Save field settings_.
+
[width="100%",frame="topbot",options="header"]
|================================
|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 page for Ingredients field.
image:images/structure-taxonomy-setup-field-settings.png["Field storage settings for Ingredients field"]
--

. On the following configuration screen, enter the values from the table below. Click _Save settings_.
+
[width="100%",frame="topbot",options="header"]
|================================
|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 > Vocabulary | 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 section of field settings page for Ingredients field.
image:images/structure-taxonomy-setup-field-settings-2.png["reference type field settings",width="100%"]
--


. 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 showing Ingredients field on Recipe content type.
image:images/structure-taxonomy-setup-finished.png["Manage fields page for Recipe content type",width="100%"]
--

// ==== Expand your understanding

//==== Related concepts

==== Videos

// Video from Drupalize.Me.
video::https://www.youtube-nocookie.com/embed/EbsXffnjsjc[title="Setting up a Taxonomy"]

//==== Additional resources


*Attributions*

Written and edited by https://www.drupal.org/u/bsnodgrass[Bob Snodgrass],
and https://www.drupal.org/u/jojyja[Jojy Alphonso] at
http://redcrackle.com[Red Crackle].
