Could someone detail out how to create additional tabstyles? I found some info in the issue queue about using theme override functions, unfortunately this is not my strength. However, I am adept at CSS, so I would like to create 2 or 3 additional styles that are selectable. I sounds like a need something in my template.php file telling it to recognize additional styles in their folders, but I do not know how to do that. Thanks.

Comments

pasqualle’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev

no theme override is needed.
If you would like to create a new style for 2.x release, then check the css files in the tabstyles folder. They are just simple CSS files. If you create a new folder there, and add a css file with the same name then it will be automatically recognized by the QT module.

theme override functions are only necessary if you want to change the html structure of the quicktabs, but that could break the module functionality as the jquery (which hides the tabs) heavily relies on the structure and the markup.

spiffyd wrote a blog post about QT styling: http://spiffyd.com/blog/theming-quick-tabs-drupal

pasqualle’s picture

if you would like to separate your styles (if do not want to put anything in the module folder) then you can do it with a new module which implements the hook_quicktabs_tabstyles().

/**
 * Implementation of hook_quicktabs_tabstyles().
 *
 * This hook allows other modules to create additional tab styles for the Quick Tabs module.
 *
 * @return array
 *   An array of key => value pairs. Where key is the location of a css file and value is the name of the style.
 */
Macronomicus’s picture

@Pasqualle
Can that hook also go in the template.php file? Does it have to be implemented in a module?

pasqualle’s picture

No, it does not have to. Hooks can be implemented in the template.php file also..

mr.baileys’s picture

No, it does not have to. Hooks can be implemented in the template.php file also.

I don't think that's correct. QuickTabs uses module_invoke_all('quicktabs_tabstyles') to discover the available tab styles, and module_invoke_all only invokes hooks in modules, not in themes (or template.php).

duckzland’s picture

Version: 6.x-2.x-dev » 7.x-3.4

yes, confirmed here, implenting hooks in template.php won't work.

Won't it be better if we use drupal_alter() instead of module_invoke_all() ? so invoking the hook in template.php will work and more theme can include default per theme style for quicktabs?

smustgrave’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

With D7 EOL approaching in a month I'm starting to triage the D7 side of quicktabs queue. This doesn't appear to have any code so believe this may not make it, sorry! Thanks though!

If still an issue or needed for 4.0.x (latest branch) feel free to reopen