Drupal - Add classes to quick tabs and nested tabs within quick tabs

Have you read this issue. Try to apply the patch by using git apply command line :

$ git apply --directory=path/to/module-dir/ add-custom-class-656330-6.patch

If you don't use git, add this line in the theme_qt_quicktabs_tabset function near the line 589 on the quicktabs.module file and the function will become :

<?php
function theme_qt_quicktabs_tabset($vars) {
   if ($key == $vars['tabset']['#options']['active']) {
     $item['class'] = array('active');
   }
   $item['class'][] = drupal_html_class($tab['#title']);# new line added by the patch
   $item['data'] = drupal_render($tab);
   $variables['items'][] = $item;
 }
?>

of course WITHOUT the <?php ?> tags

After that you have the title in class attributes :

Example :

  • tab title => given tab title
  • automatic tab class => given_tab_title

Wish helps :)

Tags:

7

Blocks