Hello,
I have to wrap the $tab['title'] within some tags. I guess I have to overwrite theme_quicktabs_tabs?
Here is what I did...
function phptemplate_quicktabs_tabs($quicktabs, $active_tab = 'none') {
$output = '';
$tabs_count = count($quicktabs['tabs']);
if ($tabs_count <= 0) {
return $output;
}
$index = 1;
$output .= '<ul class="quicktabs_tabs quicktabs-style-'. drupal_strtolower($quicktabs['style']) .'">';
foreach ($quicktabs['tabs'] as $i => $tab) {
$class = 'qtab-'. $i;
// Add first, last and active classes to the list of tabs to help out themers.
$class .= ($i == $active_tab ? ' active' : '');
$class .= ($index == 1 ? ' first' : '');
$class .= ($index == $tabs_count ? ' last': '');
$attributes_li = drupal_attributes(array('class' => $class));
$options = _quicktabs_construct_link_options($quicktabs, $i);
$output .= '<li'. $attributes_li .'><a href="'. /* ??? */ .'"><span class="tab-left"></span><span class="tab">'. $tab['title'] .'</span><span class="tab-right"></span></a></li>';
$index++;
}
$output .= '</ul>';
return $output;
}
I don't know what to use as link and how to implement $options... the links are empty at the moment but nevertheless they work fine. Strange! :)))
Help is much appreciated.
Kind regards,
Stefan
Comments
Comment #1
design.er commentedHallo,
I found this snippet (from Theme templates):
It would work exactly the way I need it. The only problem is that
_quicktabs_construct_tab_attributes($quicktabs, $i)seems not to be declared. I get a WSOD with the following error message:Fatal error: Call to undefined function _quicktabs_construct_tab_attributes() in D:\DEVELOPMENT\xampp\www\mysite\sites\all\themes\mytheme\template.php on line 397I see that this function was in earlier versions of QuickTabs but was dropped and is part of
_quicktabs_construct_link_options(?).Please can somebody help me with
$attributes_a?If this is not possible this is my second possibility:
The problem here is that it prints the
<span>tags as plain text. If I try to extend the $options variable (with the commented line) to call it as html element I receive a WSOD withFatal error: Unsupported operand types in D:\DEVELOPMENT\xampp\www\mysite\includes\common.inc on line 1582.Please can somebody help me with the markup of one of this two snippets.
Help is much appreciated. Thank you very much.
Stefan
Comment #2
pasquallereplace
with
Comment #3
design.er commentedAwesome, it works. Thank you very much, Pasqualle.
You rock! :)
Comment #5
doublejosh commentedStill accurate?
Cleaner way to get some extra HTML into tabs? ie. wrapping
<a>links in<span>tags?Comment #6
Courtney.B commented@doublejosh,
To get the
<span>tags to wrap around the<a>you can change the following line from this:to this:
Otherwise, to just get
<span>tags to wrap around the text inside the<a></a>, use the following:This is just a simplified version of solution #2.
Full function to copy and paste in template.php of simplified #2:
Comment #7
iamEAP commentedJust a quick note about the above:
I looked into the $quicktabs array and found that $quicktabs['machine_name'] didn't exist, but all of the module code references $quicktabs['qtid']. (This is on the latest stable 2.0, rather than any previous release candidate.)
So in the above code, you'd replace...
tab['title'] = tt("quicktabs:tab:{$quicktabs['machine_name']}--$tabkey:title", $tab['title']);With...
$tab['title'] = tt("quicktabs:tab:{$quicktabs['qtid']}--$tabkey:title", $tab['title']);Comment #8
vvs commentedHow to do this for 7 version?
Thanks!