Bootstrap style Quicktabs in Drupal


Got the Drupal Bootstrat theme installed and looking to get "bootstrat" style QuickTabs? Edit template.php and add:

<?php
function bootstrap_qt_quicktabs_tabset($vars) {
  
$variables = array(
    
'attributes' => array(
      
'class' => 'nav nav-tabs',
    ),
    
'items' => array(),
  );
  foreach (
element_children($vars['tabset']['tablinks']) as $key) {
    
$item = array();
    if (
is_array($vars['tabset']['tablinks'][$key])) {
      
$tab $vars['tabset']['tablinks'][$key];
      if (
$key == $vars['tabset']['#options']['active']) {
        
$item['class'] = array('active');
      }
      
$item['data'] = drupal_render($tab);
      
$variables['items'][] = $item;
    }
  }
  return 
theme('item_list'$variables);
}

?>
© 2011 Adam Gerson.