Is it possible to set a particular tab as default without using a URL argument (as described in #308633 ) ?
I'm using QuickTabs for a semi-dynamic week calendar here: http://www.clevelandbicycleweek.org (scroll down half-way.)
It's nearly Tuesday, and I figured there was an easy way to set each current day's tab as default -- (even if I have to set it manually.)
I could do an HTTP redirect to ?quicktabs_1=2 ... but redirects are relatively expensive.
Maybe there's a feature I'm missing or a more appropriate solution than QuickTabs?
Comments
Comment #1
askit commentedI have the same problem. It will be better if users can set default tab with Admin UI.
Comment #2
pasqualleyes, you are right, it would be nice..
Comment #3
stella commentedHere's a patch that provides this functionality, though it's not present when adding a new quicktab because there's none to choose from.
Comment #4
pasqualle@stella quick question: is it a problem for you if this feature would be part of 6.x-3.x, but not part of 6.x-2.x? as I do not know when 6.x-3.x version will have stable releases. Are you comfortable using 6.x-3.x-alpha on sites where you need this feature?
Comment #5
stella commentedwell i'm running a version of 6.x-2.x quicktabs with this patch applied, and i'm happy to keep re-rolling it as needed, so feel free to postpone to 3.x
Comment #6
katbailey commentedHi All,
I'm happy to commit this patch to the 2.x version - have tested it on some existing sites and it causes no problems at all - all a user has to do is run update.php and they have this functionality. Any further comments before I commit to 2.x?
Thanks Stella!
K
Comment #7
jeffschulerAwesome: thanks Stella and katbailey!
Patch worked great on 6.x-2.x-dev.
What would make it really useful for me would be to allow that choice to be done programmatically: if I could provide a bit of php to choose the tab.
For example, in the case of the site I originally mentioned, where each tab is a day of the week, I'd find the current date then set the default tab based on it...
RTBC, tho, IMHO.
Comment #8
alanburke commentedLooks like it could be done programatically with this patch.
You can define
in your code [as far as I can see]
Alan
Comment #9
alanburke commentedHmm, I'm not sure this will do the trick [for me :-) ].
The function _quicktabs_get_active_tab($quicktabs)
doesn't ever return NULL, it will always return the key of the quicktabs array, if it exists.
So I moved the test for the default tab down to that function.
Seems to do the job for me.
I can now define
$quicktabs['default_tab']in my manually created $quicktabs array.
Alan
This review is powered by Dreditor.
Comment #10
alanburke commentedComment #11
katbailey commentedFinally committed this with a few minor changes: http://drupal.org/cvs?commit=312044
FYI, here's the final patch that got in. Thanks Stella and Alan and sorry for taking so long!