Can anyone tell me how to add list classes to quick tabs tab lists in drupal 7. it seems that in drupal 6, first and last classes are added by default, but in drupal 7, only the active class is used. Can anyone please help?
Can anyone tell me how to add list classes to quick tabs tab lists in drupal 7. it seems that in drupal 6, first and last classes are added by default, but in drupal 7, only the active class is used. Can anyone please help?
Comments
Comment #1
jeremycaldwell commentedI actually got this working the other day as I needed to have classes on my tabs so I could style them differently. So now I have class names like "tab-1" and "tab-2" so it makes things much easier than using the nth selector in CSS3 and finding workarounds for IE.
Anyways here is the code. Add it to your theme's template.php and in this case I was using the jQuery UI tabs style for my Quicktabs.
Be sure to replace "YOURTHEME" with your theme's name and clear the cache on the Performance page so it picks up these changes. That should then add the class names to your tabs.
Comment #2
bolo79 commentedThanks!
Comment #3
somalinet commentedHello,
drupal7/quicktabs 7.x-3.0: the first and last tab classes are missing when using quicktabs renderer. excel style looks broken. No problem with drupal6. My quick remedy was to add a couple of lines to theme_qt_quicktabs_tabset function in quicktabs.module
Comment #4
graylawry commentedThanks for this. I used this to add a span and the class of "last" on the last tab.
Comment #5
awolfey commentedHere's a patch that changes function theme_qt_quicktabs_tabset() to use theme_item_list(), which adds first and last classes.
Comment #6
awolfey commentedSorry, use this one.
Comment #7
brycesenz commentedThe patch in #6 worked beautifully for me.
Comment #8
katbailey commentedReally sorry for the delay on this. Committed (with just a small change to initialize the $variables array for readability): http://drupalcode.org/project/quicktabs.git/commit/5831140
Comment #9
katbailey commentedComment #10.0
(not verified) commentedSpecified problem with quicktabs in Drupal 7.