Download & Extend

Allow Zen theme to render tabs properly

Project:Javascript Tools
Version:6.x-1.x-dev
Component:Tabs
Category:feature request
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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).

AttachmentSize
Snap1.png23.69 KB

Comments

#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).

AttachmentSize
jstools_add_span_to_tabs_1.patch 827 bytes

#3

Status:active» needs review

#4

Status:needs review» reviewed & tested by the community

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

Version:5.x-1.1» 6.x-1.x-dev

Re-rolled to D6. The zen in me is much happier :)

AttachmentSize
tabs_compatible_with_zen_theme_9.patch 1.01 KB

#10

patch works and should be committed to D6