1

I have a view of all of the terms in a vocabulary. How can I in the same view list the number of tagged nodes for each term? Thanks

2 Answers 2

1

First you have to make sure you can get the nodes tagged with each term to display, and then we'll get them so their COUNT is listed.

  1. Add the 'Taxonomy term: Content with term' Relationship to your terms view (under the 'Advanced' section)
  2. Now you should be able to see, in the list of fields, things such as Content: Title, etc. Add the content title, and make sure it's set to use your newly created relationship.

This should get all the nodes tagged with each of your terms to be displayed under the term. But how to count them??

The way you can do that is by enabling the use of aggregation for your view! Under the 'Advanced' section of your view, locate the 'Use aggregation' setting and make sure you enable it. It's disabled by default:

enter image description here

Once you've done that, you'll see by all of your fields a new 'Aggregation settings' field, which you can set to be 'Count' for the node title that relate to each taxonomy term.

enter image description here

That should do it! Let us know if you get it working! :-)

1

If the tag name is a contextual filter, there is also another alternative:

  1. Go to the view's contextual filter definitions

    contextual filter defintions

  2. On the resulting popup, check the 'Dispay a Summary' radio option:

    Display a summary option

  3. Notice that the 'Display record count with link' option is checked by default.

  4. Press 'Apply' to save the changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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