Using taxonomy with views

Taxonomy

Taxonomy alone does not actually do anything to your content nodes. Instead, it provides customizable values that other features can use to organize, filter, and sort the content for display.

Note: Before you can begin to build custom displays using Taxonomy on your site, you must first enable the Views module.

Creating a view with grouped content

Views can use taxonomy to organize your display, grouping content together on the page around related taxonomy terms. The result is a list of headers featuring your terms, under which appears the relevant content nodes.

To format your view for Taxonomy:

  1. Go to Structure > Views.
  2. Find the listing for your view, and then click its edit link.

    Edit link

  3. Expand the Edit Page details or Edit Block details section, based on the type of view you're editing.

    Edit Page details section.

  4. To format your view's display, in the Format section, click the Content link.

    Content link

  5. Select the Fields option, click Apply (all displays), and then click Apply (all displays) on the following window.
  6. To add a Taxonomy field to your view, in the Fields section, click the add link.

    Fields add link

  7. Select the Content: All taxonomy terms check box, and then click Apply (all displays).
  8. Clear the Create a label check box, select the Exclude from display check box, and then click Apply (all displays).

    Configure field window

  9. In the Format section, click the Settings link.

    Format Settings link

  10. In the Grouping field drop-down menu, select Content: All taxonomy terms, and then click Apply (all displays).
  11. Click Save.

Your view now groups content using each item of content's taxonomy terms.

Filtering view content using terms

You can use filters to limit the content that a view displays, based on the terms assigned to your website's content nodes.

To add a taxonomy term filter to your view:

  1. Go to Structure > Views.
  2. Find the listing for your view, and then click its edit link.

    Edit link

  3. Expand the Edit Page details or Edit Block details section, based on the type of view you're editing.

    Edit Page details section.

  4. In the Filter criteria section, click the add link.

    Filter criteria add link

  5. Select the Content: Has taxonomy term check box, and then click Apply (all displays).
  6. Select the vocabulary that contains the terms that you want use to filter the view.

    Available vocabularies

  7. Click Apply and continue.
  8. In the Operator section, select how you want to filter the view's content:
    • Is one of - Displays content with at least one of the tags entered in the Select terms from vocabulary field.
    • Is all of - Diplays content with all of the tags entered in the Select terms from vocabulary field.
    • Is none of - Displays content with none of the tags entered in the Select terms from vocabulary field.
    • Is empty (NULL) - Displays content with no taxonomy terms.
    • Is not empty (NOT NULL) - Displays content associated with any of terms in the vocabulary you selected.

    Operators options

  9. Select the Reduce duplicates check box, and then click Apply (all displays).
  10. Click Save.

Your view now displays your website's content based on the term filters you configured.

Feedback