taxonomy term count nodes Drupal

taxonomy term count nodes Drupal 6

It is possible to use taxonomy_term_count_nodes() or write your own query to retrieve the number of nodes attached to any particular term, but this can hinder performance if you want to display node counts for a lot of terms at the same time.

Instead of counting nodes on the fly, Term Node Count keeps track of all term’s node counts in its own database table and exposes that data to views. This makes displaying node counts for a list of terms much easier and much more efficient.

If at any time the data stored by this module is corrupted by outside influences (i.e. another module), you can always restore node counts to their proper values by disabling, uninstalling and reinstalling the module.
taxonomy_term_count_nodes(20, ‘blog’);
• It returns the number of nodes made in taxonomy for a given content type.
• First argument is the taxonomy id….. id of the taxonomy for which you are going to count nodes.
• Second argument is the content type….against that this taxonomy nodes counting will be done.

Was this article helpful?

Related Articles