How to Create And Use Taxonomy in Drupal?

Taxonomy is a core module in Drupal, playing a vital role in connecting, relating, and classifying your website content. In Drupal, terms are organized into “Vocabularies,” and Taxonomy helps them create, manage, and apply these vocabularies. Follow the steps below to create and implement taxonomy in your Drupal website.

Creating a Taxonomy:

Step 1:- Log in to your Drupal admin and go to Structure > Taxonomy.

Taxonomy in Drupal

Step 2:- To create a new taxonomy, click on the + Add vocabulary button.

Taxonomy in Drupal

Step 3:- Now fill in the value in the “Add vocabulary” section.

Taxonomy in Drupal
  • Name:- Enter the name of the vocabulary.
  • Description:- Enter the description of the vocabulary.

Step 4:- To save the vocabulary, click on the Save button

Taxonomy in Drupal

Adding terms to vocabulary:

After creating a vocabulary, it is necessary to add the terms to that vocabulary.

Step 1:- Click on the Add term button.

Taxonomy in Drupal

Step 2:- Enter the value on the “Add term” values.

Taxonomy in Drupal
  • Name:- Enter the name of the terms.
  • Description:- If you want you can add the description of the terms.
  • Text format:- You can choose the text format between “Basic HTML“, “Restricted HTML” and “Full HTML“.
  • Relations:- You can add the relations like “Parent terms” and “Weight“. Note: Terms are shown by weight in ascending order.
  • URL alias:- Indicate a different path that can be used to access this data. When creating an about page, for instance, write “/about”.
  • Published:- Click on this toggle button, if you want to enable or disable the terms.

Step 3:- Click the Save button once all the fields have been filled out.

Taxonomy in Drupal

It will look like this after saving the terms.

Taxonomy in Drupal

Assigning Taxonomy to Content Types:

Step 1:- To assign the taxonomy on content types, click on Structure > Content types.

Taxonomy in Drupal

Step 2:- Choose the content type you want to associate with the taxonomy. Afterward, select the “Manage fields” option.

Taxonomy in Drupal

Step 3:– Click the button and choose “+ Create new field” from the options. Next, choose “Taxonomy term” as the kind of field.

Taxonomy in Drupal

Step 4:- Enter the value on the required fields.

Taxonomy in Drupal
  • Help text:- Enter ingredients that site visitors might want to search for.
  • Reference type > Reference method:- Select the method used to choose allowed values.
  • Reference type > Create referenced entities if they don’t already exist:- Whether the content editing form allows for the creation of additional ingredient words.
  • Reference type > Vocabulary:- Select the vocabulary to choose allowed values from that vocabulary.

Step 5:– Choose the “Save settings.” option.

Taxonomy in Drupal

Display taxonomy in frontend.

Step 1:- Now go to the “Content” and choose the existing content to add the taxonomy.

Taxonomy in Drupal

Step 2:- In the Ingredients section search the terms that you created in the vocabulary section.

Taxonomy in Drupal

Step 3:- Click on the Save button, to save the content.

Taxonomy in Drupal

Result:-

Taxonomy in Drupal

Please contact us at manish@bay20.com or call us at +91-8800519180 for any support related to Drupal. You can also visit the Drupal development page to check the services we offer.