Hi,

I'm trying to get the zebra stripes to work within the taxonomy_context module. Tried mucking around with the taxonomy_context.module file, but getting nowhere. Anyone have any ideas? in baby-step language?

Thanks!

Comments

mroscar’s picture

In taxonomy_context.module add those lines +

function theme_taxonomy_context_subterms($terms) {

+$count = 1; //add

  $output = '';
  if (count($terms)) {
    foreach ($terms as $term) {
      taxonomy_context_load('term', $term);
      $term->subterm = TRUE;
+    $term->count = $count;//add
      $term->teaser = isset($term->description) ? node_teaser($term->description, isset($term->format) ? $term->format : NULL) : '';
      $term = taxonomy_context_prepare($term, TRUE);
      $term->links = module_invoke_all('link', 'term', $term);
      $output .= theme('taxonomy_context_term', $term);
+    $count = $count+1; //add

    }
  }
  return $output;
}

then also in that function

function theme_taxonomy_context_term($term) {

  $type = $term->subterm ? 'subterm' : 'term';
  $clear = $term->subterm ? '' : ' clearfix';
+  $taxzebra = ($term->count%2) ? '-odd' : '-even';

  $output = '';
+  $output .= "<div class=\"$type-container $type-container$taxzebra\">\n";
+  $output .= "  <div class=\"$type $type$taxzebra\">\n";

thats it :)

will give you odd even divs then rest is css