Check the theme directory for Tab Styles?
Jacine - May 5, 2009 - 22:43
| Project: | Quick Tabs |
| Version: | 6.x-2.x-dev |
| Component: | Tab styles |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hello ;)
I'm trying to add custom Quick Tabs styles for a theme I'm working on, and had to write a module for the sole purpose of hooking in to scan the theme for tab styles.
I was wondering if it wouldn't be too hard to scan the active theme for a tabstyles directory in quicktabs_quicktabs_tabstyles()? Or maybe there is a way to do this in the theme that I'm missing?
Thanks!

#1
#2
As I know any hook can be implemented in the theme same way as it is implemented in the module..
MYTHEMENAME_quicktabs_tabstyles()
#3
ok, the previous comment is wrong
the only hook which can be implemented in the template.php file is hook_theme()
#4
This is a great idea, i have created my own tab style but it is in the module directory which I don't like.
#5
+1 for this. I'd even suggest taking it further: this module should hardcode the default tab styles' paths, and then ONLY scan theme directories for additional custom styles.
Requiring themers to create custom CSS in a module directory is just a bad idea -- it's confusing up front, and risks being overwritten during module upgrades. It really belongs in the theme, and should be the default behavior.
#6
OK, I've been thinking about this further and realized that there are some complications with scanning theme directories:
1) Many Drupal sites these days use an admin theme (and in D7 this is the default) that is different from the public facing theme.
2) Even more complicated, some sites use other types of theme-swapping: per user, per group, per section, on demand etc.
Basically, you can't assume that the active theme is the only theme. So if Quick Tabs was checking theme directories for tab styles, it's unclear which directories it would be correct to check, and in what order, or how it should preview a tab style on the admin page in an admin theme when the tab style is defined in a different theme. All very problematic.
I'm not sure what the right answer is, but I think it might lie in discouraging users from creating custom tab styles rather than encouraging it, and instead directing them to documentation of best practices for overriding the "no style" tab style in the theme layer. Maybe it just needs a little tweaking to make it easier for themers to add IDs and classes, too.
In my opinion, the underlying issue is that the Quick Tabs module tries to move too much theming logic into the admin interface, and I wonder if it might be good to separate them into two modules (still downloaded together): Quick Tabs and Quick Tabs Style Pack. The style pack would be available for people who want a visual interface, but the basic Quick Tabs install would just be unstyled and would encourage "proper" theming.
Anyway. This is a big topic for a small module, and may be more than the maintainers want to bite off, but I'm happy to keep discussing it, particularly as the module is getting ported to D7. Let me know.