-3

How can you display a vocabulary term list with node count?

I have a vocabulary named books authors, I want to display a list of the terms which includes the total number of nodes next to each term. Like this:

  • William Shakespeare (4)
  • Xyz (6)
0

You can do this by using the Views module.

  1. Create a new View of type Content, filter to all the Content type nodes relevant for your case.

  2. Then add a Contextual filter (under Advanced in Views) for the Field Has taxonomy term ID and configure it to display a Summary:

    When the filter value is NOT available
    Display a summary
    Format List
    Base path (you must enter the Page path if this isn't the first Page Display in your Views)
    Display record count with link

  3. If your Taxonomy reference field accepts more than one value (so your nodes can be tagged with more than one term) also check out the options under:

    More
    Allow multiple values

You will see a list of tags with the count in brackets. You can click on the terms from the Summary and see the relevant results in a separate page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.