Apparently, when a page falls into multiple categories, menu trails picks one (probably the first) and marks the appropriate parts of the menu active. However, I would prefer if menu trails takes into account term should be chosen to base the menu trail on. An example:

Page A is categorized with term X and Y.
This causes the page to be listed on .../taxonomy/term/X and .../taxonomy/term/Y. Each can (and in my case do) have different menus.
Now if a visitor clicks on page A and comes from .../taxonomy/term/X, menu trails should make that particular trail active. The same holds if a visitor clicks on page A and comes from .../taxonomy/term/Y.

Comments

pvanderspek’s picture

By the way, the problem listed in this post is similar to what I´m referring to: http://drupal.org/node/149043
I'd prefer the solution to be implemented in menu trails, but this might work as well?

pvanderspek’s picture

Well I did some hacking to the module code and this is what I came up with:

$referrer = $_SERVER['HTTP_REFERER'];
$pos = strrpos( $referrer, '/');
$refid = substr( $referrer, $pos + 1);
$matchrefid = false;
foreach($node->taxonomy as $tid => $term) {
  if ($term_trails[$tid] > 0 && !$matchrefid) {
    $mid = $term_trails[$tid];
      if($tid == $refid) {
        $matchrefid = true;
      }
  }
}

I added the HTTP_REFERRER code to 'menutrails_node_location' and it seems to work. Hopefully this can be added to the code of the module. For now, I'll leave my personnally modified version in place.

pvanderspek’s picture

It's over a month since I posted this ticket. Has anything been done with it?

sun’s picture

Status: Active » Closed (won't fix)

Sorry, Menu Trails for Drupal 5 is not actively developed/maintained anymore. Only issues containing patches may still be considered. Feel free to re-open this issue if you want to provide a patch.