1

In drupal 6 , Term Node Count were the module which was developed to store number of nodes containing each taxonomy term in DB , but it is not developed for Drupal 7 . Now my question is : "Is there any module like Term Node Count in Drupal 7 ? if not what solution do you present for this problem "

Note : In a project with thousands of taxonomy term I want to know which terms are used most and on the fly calculation will become too time consuming.

1

You should be able to do this with Views, I am pretty sure that is why the D7 port did not happen for Term Node Count (see: https://www.drupal.org/node/603868). A view can be cached so it will essentially store the value as that module did but it will update more frequently (or less if you want to set the cache up like that) and give more flexibility to where you can display the information. You can setup a view pretty easily for this:

This is just one way to get the information but the view will really depend on your use case for what you need the count for:

In Fields: add Taxonomy term: Name In Relationships, add a Taxonomy term: Content with term Add a contextual filter for Taxonomy term: Name Choose 'Display a summary' Choose 'Display Record count with link'.

Views is a very flexible module and chances are you are probably already using it, it will work for most all needs. You can also do this yourself in code pretty easily by doing the count and storing it statically then writing a update function that will update the term count every once and a while but it will cut down on flexibility but I tend to go for code if it makes sense.

| improve this answer | |
  • vote up, I am agree with you, this solution work – Yuseferi Aug 7 '15 at 6:19

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.