Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sorry for this newbie question.
I couldn't find out how to so please forgive me to ask here..
How can I use vertical tabs for taxonomy selection list in node edit page?
All the fields are now in separate vertical tabs but only the taxonomy list is out of there and stays on the top of node edit page.
I saw some issues with like hierarchical select module but I don't even find how to include it into Vertical Tabs.
Comments
Comment #1
doublejosh CreditAttribution: doublejosh commentedI was able to do this, but not if the node type is a product.
Comment #2
chinita7 CreditAttribution: chinita7 commentedAlright. My node type is actually a product. Thant's way it doesn't work.. Thanks anyway.
Comment #3
doublejosh CreditAttribution: doublejosh commentedI was wrong.
It's working fine on the product type now. The issue seems to be the "Minimum number of tabified fieldsets to show vertical tabs:" which is defaulted to 3. Even though it doesn't quite state that in that setting description, it seems that you have to have at least that number of vocabs on the node type to get the vertical tab.
Does this do it for you?
Regardless of this "solution," you still can't explicitly put just one vocab in without dealing with this setting, which is possible with the more flexible field system in 7. You can use Content Taxonomy to gain this kind of control.
Comment #4
chinita7 CreditAttribution: chinita7 commentedThanks for letting me know. I actually have only two vocabularies on D6. Content Taxonomy might be a good idea I'll have a look.
Comment #5
Bartezz CreditAttribution: Bartezz commentedCreate a custom module and use the code below
Cheers
Comment #6
doublejosh CreditAttribution: doublejosh commentedExcellent solution.
Looks like a great work around for folks with just one big vocab that needs a tab.
Other folks can just set their number appropriately.
Personally pick the forms slightly differently.
Comment #7
Bartezz CreditAttribution: Bartezz commented@doublejosh; Also use a check that a vocabulary is actually enabled for the content-type! Problem is that some users might not have a permission. Or maybe later in the project a vocabulary is removed from a content-type. Your code would leave users with an empty fieldset in the node edit page!
I'm using is_int(key((array)$form['taxonomy'])) as the $form['taxonomy'] array might exist even if there is no vocabulary active for that particular content-type, the array will contain keys/values like #tree and such. If there IS a vocabulary active then $form['taxonomy'] will contain numeric keys where the numeric key is the VID, hence my is_int check :)
Cheers
Comment #8
doublejosh CreditAttribution: doublejosh commentedGotcha. Awesome. Thorough :)