Drupal Lite: Work with Tags to Classify Pages

Tags are added to content to classify it. Tags can also be used as filters when displaying lists of content on a page, for example, a list of biographies of all Faculty, or a list of all news articles tagged Conference 2020. Drupal Lite organizes tags within the Taxonomy module. The taxonomy has a default vocabulary, and the vocabulary contains Tags (also known as Terms).

Drupal Lite Taxonomy Implementation

In Drupal Lite 8 the Taxonomy is configured such that:

  • It uses a Free-Tagging system.
    • A term can be added to the vocabulary when creating or editing content.
  • Tags are case-sensitive.
    • Goldy and goldy are two separate and unique tags.
  • All three default content types (General Page, Biography, News/Blog) have a field called Tags for this content where you can add tags.
    • When adding tags, the field will display an auto-complete list of tags containing the characters.
    • If no match is found, the tag will be added to the vocabulary when the content is saved.
  • General Pages have a field called Tags for filtered views, which is passed in to either a Related Biographies Block or Related News/Blog Block. Those blocks can be added to the layout from the Layout Builder.

Adding Tags to content

  1. Edit the content
  2. Scroll down to Tags for this Content.
    • Start typing a tag. The autocomplete will display a list of matching tags
      the tags field. the text "picot" is entered in the field. the pick list displays "Picotechnology, Classes" and "Picotechnology, News"
    1. Select the tag from the autocomplete list, or finish typing the tag to add the new tag to the vocabulary
    2. Click Add another item to add an additional tag
      • Content can have unlimited tags
  3. Click Save

Using Tags to create filtered lists

Filtered lists of content can be added to General Pages. The filter that is applied comes from the tags entered in the field Tags for filtered views on the General Page edit form. If multiple tags are entered, they are treated as OR conditions.

  1. Edit the content.
  2. Scroll down to the Tags for Filtered Views.
    • The Tags for Filtered Views will only appear on a General Page.
  3. Enter one or more tags.
    the tags field. two tags are displayed: "Picotechnology, Classes" and "Picotechnology, News"
    • In the example above, this content would be included in a view that uses either Picotechnology, News OR Picotechnology, Classes as a tag.
    • The number in parentheses is the Tag ID that is added when the page is saved. It is used for internal Drupal purposes.
  4. Select Save.
  5. Select the Layout tab at the top. The Layout Builder is displayed.
  6. Select +Add Block in the region where you want to add the filtered list. The Choose a Block palette is displayed.
    • In Drupal Lite - Lists (Views), select either Related Biographies Block or Related News/Blog Block.
  7. Select Save.

Managing Tags

The ability to manage tags is based on your role in the Drupal Lite 8 site. If you do not see the Taxonomy menu item in the Admin menu, contact your site administrator.

View, Edit, or Delete Tags

  1. Select Manage in the Admin Menu at the top of the page
  2. Mouse over Structure in the sub-menu
  3. Mouse over Taxonomy in the third level menu
  4. Select Tags

The list of tags is displayed.

  • Select the Tag name to view all content with that tag.
  • Select Edit in the operations column to edit the tag.
  • Select the drop-down arrow on the edit button and click Delete to delete a tag.
    the tags interface showing a table with one item named Picotechnology, Classes and an Edit button on the right.

If you change the spelling of a tag, it will be updated on all content that has that tag.

If you delete a tag, it will be deleted from all content.

Merging Tags

There is no way to merge tags. If there are two (or more) tags you want to combine -- either because there is a spelling similarity (goldy and glody), or case difference (goldy and Goldy), you need to tag the content with the term you want to keep, and then delete the other tag.

For example, if there are two tags -- goldy and Goldy, and you want to keep the tag Goldy:

  1. Go to the list of tags (see above)
  2. Select the tag goldy (i.e., the tag to get rid of)
    • For each item that is listed, edit the content and add the Goldy tag
  3. Go to the list of tags
    • Delete the tag goldy

Last modified