Index: views_cloud.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/views_cloud/views_cloud.module,v
retrieving revision 1.3
diff -u -r1.3 views_cloud.module
--- views_cloud.module	17 Sep 2008 16:02:42 -0000	1.3
+++ views_cloud.module	7 Apr 2009 13:20:14 -0000
@@ -84,6 +84,31 @@
   $min = 1000;
   $max = -1000;
   foreach ($vars['rows'] as $id => $row) {
+    $parents = '';
+    // If the taxonomy parent option is checked
+    if ($view->style_plugin->options['use_parent']) {
+      // Grab all parents
+      $parents = taxonomy_get_parents($vars['rows'][$id]->term_node_tid);
+      if (is_array($parents)) {
+        // Isolate top parent
+        $topparent = array_shift($parents);
+      }
+    }
+    
+    if ($topparent) {
+      // Change tid and name to topparent tid and name before doing all the other handling
+      $vars['rows'][$id]->term_node_tid = $topparent->tid;
+      $vars['rows'][$id]->term_data_name = $topparent->name;
+      // Iterate trough all results to find duplicates of our topparent
+      foreach ($vars['rows'] as $id2 => $row2) {
+        // If the id is different (they aren't the same result) but the term tid is the same (they are duplicates of eachother)
+        if ($id != $id2 && $row->term_node_tid == $row2->term_node_tid) {
+          // Aggregate the count and remove the second one
+          $vars['rows'][$id]->num_records +=  $vars['rows'][$id2];
+          unset($vars['rows'][$id2]);
+        }
+      }
+    }
     $vars['rows'][$id]->link = $argument->summary_name($row);
     $args = $view->args;
     $args[$argument->position] = $argument->summary_argument($row);
Index: views_cloud_plugin_summary_style_cloud.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/views_cloud/views_cloud_plugin_summary_style_cloud.inc,v
retrieving revision 1.1
diff -u -r1.1 views_cloud_plugin_summary_style_cloud.inc
--- views_cloud_plugin_summary_style_cloud.inc	17 Sep 2008 16:02:42 -0000	1.1
+++ views_cloud_plugin_summary_style_cloud.inc	7 Apr 2009 13:20:01 -0000
@@ -7,6 +7,7 @@
   function option_definition() {
     $options = parent::option_definition();
     $options['randomize'] = array('default' => TRUE);
+    $options['use_parent'] = array('default' => FALSE);
     return $options;
   }
 
@@ -19,6 +20,13 @@
       '#description' => t("This setting respects the View's sort order when limiting large paged lists, but shuffles each list of items when displayed on the page."),
       '#default_value' => $this->options['randomize'],
     );  
+    
+    $form['use_parent'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Taxonomy: use top level terms'),
+      '#description' => t("Checking this box will make use the system assume it's dealing with taxonomy terms and it will aggregate results to the top level term."),
+      '#default_value' => $this->options['use_parent'],
+    ); 
   
   }
 }

