get number of nodes with a certain value in a CCK field?

mattgilbert - May 13, 2009 - 01:36

Is there a way for a template or a theme to find out how many nodes have a certain value in a certain cck field? Or, more generally, is there a CCK API?

Think you could do this with

ezraw - May 13, 2009 - 03:28

Think you could do this with a view and Views Calc (http://drupal.org/project/views_calc).

"This module adds simple calculations to a views table. Requires the Views module.

You can SUM, AVERAGE, COUNT, MIN, MAX, or AVG selected columns."

So if you create a view with a filter for that CCK field = whatever, and then use the COUNT function.

 
 

Drupal is a registered trademark of Dries Buytaert.