Posted by Mac Clemmens on February 13, 2009 at 2:34am
Jump to:
| Project: | Views Tabs |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
It would be nice if they showed up as term names, instead of the term numbers.
Great module!
Comments
#1
Yes, the module could use some improvements in how it handles some types of information. The port to Drupal 6 is still pretty basic at this point.
You can likely get something working relatively easily right now by overriding the theme for your tabset. In a use case I have I chose an image field as my tab field, and of course without smarter field handling it just spits out the FID of the image. I used this code as an override to get the output I wanted:
function fff_tabset($element) {foreach ($element as $key => $value) {
if ($element[$key]['#type'] == 'tabpage') {
$file = db_result(db_query('SELECT filepath FROM {files} WHERE fid=%d', $key));
$file = str_replace('/files/', '/files/imagecache/nathumb/', $file);
$element[$key]['#title'] = '<img src="/'. $file .'">';
}
}
$output = '<div id="tabs-'. $element['#tabset_name'] .'"'. drupal_attributes($element['#attributes']) .'>';
$output .= $element['#children'];
$output .= '<ul>';
foreach (element_children($element) as $key) {
if ($element[$key]['#type'] && $element[$key]['#type'] == 'tabpage') {
$output .= '<li'. drupal_attributes($element[$key]['#attributes']) .'><a href="#tabs-'. $element['#tabset_name'] .'-'. $element[$key]['#index'] .'">'. $element[$key]['#title'] .'</a></li>';
}
}
$output .= '</ul>';
$output .= '</div>';
return $output;
}
I'll try to get this module beefed up a bit as soon as I have some additional time.
Jer
#2
Most helpful, thanks! :D
#3
Cleaning up issue queue