Allow Zen theme to render tabs properly
Amitaibu - June 15, 2008 - 16:21
| Project: | Javascript Tools |
| Version: | 6.x-1.x-dev |
| Component: | Tabs |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
I had a problem using Zen theme. I'm not sure if this solution is the correct one.
I've created tabs using panels_tabs, but in the Zen theme the tabs were not rendered properly. (snap1).
Patch solves this by adding <span class="tab"> (snap2).
| Attachment | Size |
|---|---|
| Snap1.png | 23.69 KB |

#1
I only see one snap and don't understand what the issue or the suggested fix are.
#2
Ahh! the upload problems of drupal...
Here's the patch again. When applied and using the Zen theme, the tabs will appear correctly (not like snap1).
#3
#4
I have tested this patch with both Zen and Garland themes and have not found any issues.
Cheers,
Jon Antoine
www.antoinsolutions.com
#5
+1 cheers on patch, but given its a theme function, shouldn't the patch be applied to zen (e.g. zen_tabset($element){}).
#6
@gestaltware, I didn't understand - which function do you refer in Zen?
#7
Hi All,
you dont need to provide a patch for this. As you are patching a theme function just copy the function to your template.php, rename it with mytheme_function and change all the output you want.
like this:
/**
* Return rendered tabset.
* DG 22.08.2008 we override the tabs from the jstools tab module, because there are not rendering the tabs the way we want.
* First we override the tabset only.
* @themable
*/
function zen_tabset($element) {
$output = '<div id="tabs-'. $element['#tabset_name'] .'"'. drupal_attributes($element['#attributes']) .'>';
$output .= '<ul class="anchors">';
foreach (element_children($element) as $key) {
if ($element[$key]['#type'] && $element[$key]['#type'] == 'tabpage') {
// old code $output .= '<li'. drupal_attributes($element[$key]['#attributes']) .'><a href="#tabs-'. $element['#tabset_name'] .'-'. $element[$key]['#index'] .'">'. $element[$key]['#title'] .'</a></li>';
// new code;
$output .= '<li'. drupal_attributes($element[$key]['#attributes']) .'><a href="#tabs-'. $element['#tabset_name'] .'-'. $element[$key]['#index'] .'"><span class="tab">'. $element[$key]['#title'] .'</span></a></li>';
}
}
$output .= '</ul>';
$output .= $element['#children'];
$output .= '</div>';
return $output;
}
Cheers from Cologne
Dirk
#8
@Dirk,
Indeed this is a theme function, however, since Zen is a popular starting kit, instead of people looking what needs to be changed, Tabs can add this span - as it has no negative effect in other themes.
#9
Re-rolled to D6. The zen in me is much happier :)
#10
patch works and should be committed to D6