I assigned my vocab. with two node type

it's look like this : term1 => node type1 , term1=> node type2
then term node count = 2 but I only want to count node type1 that is result 1 not 2 how to do that ?

any help would be appreciated!
thank in advance.

oranjer

Comments

oranjer’s picture

Component: Miscellaneous » Code

I found the php snippet here http://drupal.org/node/233416

but i don't know how to integrate that with this module Is it possible to do ?

can anyone suggest me please .

oranjer

kenorb’s picture

Category: support » feature
kenorb’s picture

Workaround:

/**
 * Implementation of hook_views_pre_render
 */
function hook_views_views_pre_render(&$view) {
  switch($view->name) {
    case 'terms_count_data':
      // replace term counts with correct values
      $default_ctype = key($view->display['default']->display_options['filters']['type']['value']);
      $current_ctype = key($view->display[$view->current_display]->display_options['filters']['type']['value']);
      if ($ctype = ($current_ctype ? $current_ctype : $default_ctype)) {
        foreach($view->result as $index => $result) {
          $result->term_node_count_node_count = taxonomy_term_count_nodes($result->tid, $ctype);
        }
      }
      break;
  }
}
kenorb’s picture

Status: Active » Closed (works as designed)

Using 'Term Node Count' module it's not possible to do it.
It's possible to do it with Views.
See: #1132368: How to display item/node count?
Using grouping count.