Drupa 7 - Views with taxonomy term count

By xngo on June 23, 2019

In order to create a view with taxonomy terms count, do the following:

  1. Go to admin/structure/views and create a taxonomy term view(i.e. Show=Taxonomy terms).
  2. (Optional) Under Filter criteria section, set the Taxonomy term: Vocabulary that you would like to use. Otherwise, it will hammer your database and return all terms.
  3. Go to Advanced->Relationships and add your vocabulary(i.e. Taxonomy term: Content using < YOUR VOCABULARY >)
  4. Under Fields section, add Content: Nid(The node ID).
  5. Go to Advanced->Use aggregation and set aggregation to Yes.
  6. Under Fields section, click on the Aggregation settings link of the Content: Nid(The node ID) and set the aggregation type to Count.
  7. Under Fields section, for the Content: Nid(The node ID) field, empty the label , add ( to Prefix and ) to Suffix.
  8. Go to Format->Show->Settings and check both as Inline fields.


About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.