Previously posted under http://drupal.org/node/259413 when I thought this was a Panels Tabs Style issue, but seem to have fixed it with a small addition to tabs.module:
Tabs (of panel panes) were being rendered with an a href anchor that didn't include the request URI information.
For example, a user profile split into two tabs SHOULD have tab destinations similar to the following:
mysite.com/user/glottus#tabs-user-profile-userprofile-1
mysite.com/user/glottus#tabs-user-profile-userprofile-2
Problem was, they were getting rendered as href="#tabs-user-profile-userprofile-1", resulting effectively in tabs with the following destinations:
mysite.com/#tabs-user-profile-userprofile-1
mysite.com/#tabs-user-profile-userprofile-2
This caused a redirect to the main page instead of showing the correct tab content.
I seem to have fixed this on my site with the following change made to tabs.module:
in theme_tabset, change
$output .= '<li'. drupal_attributes($element[$key]['#attributes']) .'><a href="#tabs-'. $element['#tabset_name'] .'-'. $element[$key]['#index'] .'">'. $element[$key]['#title'] .'</a></li>';
to read
$output .= '<li'. drupal_attributes($element[$key]['#attributes']) .'><a href="' . request_uri() . '#tabs-'. $element['#tabset_name'] .'-'. $element[$key]['#index'] .'">'. $element[$key]['#title'] .'</a></li>';
Can anyone tell me if this was intentionally left out? Am I better off trying to theme this function, rather than hardcoding this change into the module?
Comments
Comment #1
andrewtr commentedThanks... It helped me a lot...