Sorry, but it doesn't work with ubercart products for me: menu items associated with such nodes have no "active-trail" class.
Any help would be appreciated.

Comments

keesje’s picture

Issue confirmed, though I doubt this has anything to do with this module.

malcomio’s picture

I ended up using a hacky workaround in the theme, by overriding theme_uc_catalog_item from uc_catalog.module:

function themename_uc_catalog_item($here, $link, $lis, $expand, $inpath, $count_children) {
  // ubercart menu doesn't do nice trails, so check the node...
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));
    if (uc_product_is_product($node)) {
      $terms = taxonomy_node_get_terms($node);
      $tid = end(array_keys($terms));
      $path = 'catalog/' . $tid;
      
      $last_breadcrumb = end(drupal_get_breadcrumb());
      
      if($link == $last_breadcrumb) {
        $link = str_replace(' href', ' class="active" href', $link);
      }
    }
  }
/*
then the rest of the theme function from the module
*/

I don't like it, but it works