Knowledgebase

How to configure taxonomy and add tags in Drupal

You can organize and link content on your site using taxonomy terms and vocabularies. Taxonomy terms are the tags that you add to content items (nodes). These terms are grouped into vocabularies. To manage vocabularies and terms, log in to the admin panel of your Drupal, click on the Structure tab in the top navigation bar and then on Taxonomy. This will display a table with the existing vocabularies. To edit the name and description of a vocabulary click on its edit vocabulary button in the table (the other two buttons in the table are list terms and add terms). To create a new vocabulary group click on the Add vocabulary button above the top left corner of the table. On the page that opens type a name for the vocabulary, optionally type a description and click on the Save button.

To add terms to a vocabulary, on the Taxonomy page click on the add terms button for the particular vocabulary. On the page that opens configure the settings for the term. Type its name and optionally a description in the corresponding fields. If you want to, in the field for URL alias type a friendly URL for that term. Type just the path that's added to the base URL, not the whole URL address. When a user types the URL address of a term, a list of all nodes containing that tag will be displayed on the frontend. Under the URL alias field there's a button labeled Relations. Clicking on it will show a few other options. One is for choosing the parent item of the term. By default, the term is added as a root item, but if you want to, you can make it the child of another term. The other option is for setting the weight of the term. The weight is used for changing the position of the term in relation to the other terms in the vocabulary.

On the Taxonomy page there's also a list terms button for each vocabulary. Click on it to see a table listing all the terms in that vocabulary. To change the positions of the terms use either the four-arrow buttons in front of each term, or change the row weights. It's much easier to reorder the terms in this way than to change the weight of each term on the create/edit page. There's also an edit button for each term. You can use it to change the term settings. They are the same as the ones for adding a term.

To be able to add tags/terms in nodes you need to add a Term reference field type to the particular content type. To do this go to Structure tab>Content types and click on the manage fields button for the desired content type. Then add the field and from the field settings select the vocabulary that you want to use. When you create/edit nodes from that content type you'll be able to include terms from the selected vocabulary. Only one vocabulary group can be used per field.

For more details on Drupal taxonomy and how to manage it you can check our Drupal taxonomy tutorial.

Was this answer helpful?

 Print this Article

Also Read