Closed (outdated)
Project:
Quick Tabs
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2008 at 12:18 UTC
Updated:
11 Dec 2024 at 19:14 UTC
Jump to comment: Most recent
Comments
Comment #1
pasqualleI think we can make a new feature to use tab content title (node title, block title, view title) as tabpage title. does it sound useful?
Comment #2
pasqualleMoving new features to 3.x version
Comment #3
daniorama commentedI just downloaded the new version. I will play with it and see the new features (the ajax feature works really nice!)
Comment #4
benklocek commentedVery useful feature, especially for translations of the content.
Comment #5
ManyNancy commented@#3 is this already implemented?
Comment #6
pasqualledynamic title for tabs is not implemented yet
Comment #7
askit commentedQuickTab is great, and it will be perfect if dynamic title feature is added!
Comment #8
jrabeemer commented+1^99 for this feature.
Otherwise the title is static and often not relevant to the content within the tab. :-(
Thinking about it some more, I think it would be possible to do a theme_preprocess_block() function to edit the output HTML and modify the text of a tab.
You could even do it with jQuery post load.
Either way, it's a hack.
Comment #9
flaviovs commentedWouldn't be better if we can use tokens on the title of each tab?
So if you tab has a node in it, you set its title to "[node:title]" and voilá tab title is now the node title?
I thinks that this makes the module much more flexible than if we have only a "use inner content title" on/off option.
Comment #10
pheraph commentedSubscribing
Comment #11
BeaPower commentedis this possible now?
Comment #12
design.er commentedI think, the suggestion of comment #9 is the Drupal way. It would open all the needed possibilities of dynamic content and only use the tokens the user really need - of the installed modules that provides tokens.
Comment #13
molave commentedUsing tokens would be a great idea, I think, and very flexible, and it would be implemented in a manner that current token users already understand.
Comment #14
glitz commentedsubscribe
Comment #15
g76 commented+1 for D7 as well.
Comment #16
rv0 commented+1
any programmatical workaround available for now?
Comment #17
katbailey commentedIf you are happy to build the quicktabs programmatically then you can definitely achieve this. You can either use hook_quicktabs_alter to alter an existing quicktabs instance in any way you want (in this case changing the titles to something programmatically driven); or you can build the quicktabs from scratch using quicktabs_build_quicktabs() - see the README file for details.
To add this to the UI, someone would need to write a renderer plugin that extends the Quicktabs renderer plugin and adds the token handling.
Comment #18
rv0 commented@katbailey
thanks, I used the hook_quicktabs_alter solution and it's working fine :)
Had a hard time finding info about it ;)
Comment #19
katbailey commented@rv0, well you know what to do then, don't you? ;-) Provide documentation somewhere that others can find - a patch for the readme file would be great. I have 4 branches of this module to maintain, I really appreciate patches ;-)
Oh and the stuff I said above re renderer plugins of course only applies to the 7.x-3.x branch.
Comment #20
BeaPower commentedyes @rv0 please tell us what you did, thanks.
Comment #21
rv0 commentedBeaPower - there's not really much to it, write a function yourmodule_quicktabs_alter($arg)
dpm() the $arg to see what you can do with it, and act accordingly.
if i knew more about this hook i could write some docs about it, but now i just tried with trial and error until it worked.
Comment #22
BeaPower commentedWhere do you write this? I'm still new to drupal.
Comment #23
rv0 commentedBeaPower - Look up how to write your own module: http://drupal.org/developing/modules
Install devel so you can use the dpm() function to display contents of objects/arrays/...
Comment #24
caponey commentedI am using Quick Tabs to display search results. It would be cool to dynamically insert the number of results in the title, i.e., Games (3) | Reviews (5) | Articles (20), etc...
Comment #25
BeaPower commentedSAme here, this is actually what I wanted to try and do. How do you do this?
Comment #26
BeaPower commentedany updates?
Comment #27
khoomy commentedI display block title as tab title by overriding theme function as:
You can change it for views also.
I hope this will help someone :) cheers
Comment #28
hefterbrumi commentedHI!
Could somebody point me towards the right direction on this?
I have a several products, each has a quicktab connected to it (4 tabs, each tab has a view with slideshow). I created 4 textfields to this content type, and I would like to alter the title of the tab titles according to the textfields.
I found a reply http://drupal.org/node/303453#comment-5631104. I would prefer using hook_quicktabs_alter but dont really know how to begin.
Please help.
Comment #29
rv0 commented@hefterbrumi
Install devel,
Look up how to make a module.
in the module add this
look at the result..
& change the value of $quicktabs array to your taste.
Comment #30
hefterbrumi commentedI'll give it a try thanks...
Comment #31
hefterbrumi commentedOk I have found the titles:
$...->tabs[0]['title']
$...->tabs[1]['title']
$...->tabs[2]['title']
$...->tabs[3]['title']
I am not really into coding but I need to solve this so the php will be something like:
Is that correct?
Also I cant find the variables storing the title text so the ones in the code are just guesses. For some reason I cant find them with devel.
I used :
Comment #32
rv0 commentedNo reason to use get_defined_vars.. just dpm($quicktabs) as that is the (only) argument provided in the function
I don't know what you mean with $form['titletext0'] .. there is no variable $form.. you'll need to write a helper function that gets the strings you need or hardcode it.
Comment #33
hefterbrumi commentedI see. I used get_defined_vars becaouse I thought I can get the strings this way. Hardcoding it is not a solution since its changing according to a textfield that the uploader fills out when creating a new "product".
But how do I get the strings?
Maybe field_get_items
Sorry for being stupid but I dont have experience in this....
Comment #34
rv0 commentedthere's more to it.
- field_get_items takes a node object, not a nid.. so node_load(arg(1));
- $tabs does not exist.. use the $quicktabs variable
Learn how arrays and objects work. use devel to know what functions return.
I guess learning you how to code is also outside the scope of this issue
Comment #35
hefterbrumi commentedThank you for the directions. Meanwhile I found a module called Field data extraction, I'll look into it.
Would you learn farming for one carrot :) ?
Comment #36
hefterbrumi commentedI finally solved my issue. I used quicktabs_build_quicktabs to create a new quicktab programatically and used tokens to get the values of the title field.
I used display suite to create a code field where I put the code. That I attached it to my content type.
Comment #37
snaushads commentedSubscribing. Cant do it programmatically atm.
Comment #38
ultimateboy commentedI'm interested in pursuing this, it's trivial to add site token support to the fields, but it's more difficult to add node tokens (for things like [node:author] in a tab title for example). Overall, I think it might be easier to first #2090657: Make quicktabs entity-aware and then handle tokens uniformly across all entities.
Comment #39
philyAn old issue but here is how I solved it in a custom module:
Comment #40
l.medves commentedHi,
Thank you for the great module, saved me a ton of time!
I am using the D8 version of the module and cannot find any way of dynamically changing the tab titles. I cannot find the above mentioned hook or theme function. Do you have any other ideas / suggestions?
Comment #41
smustgrave commentedWith 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