After several days of trying to figure out why Vertical Tabs was not displaying Vocabularies, I discovered that it depended on the type of vocabulary. If I have 3 vocabularies that are all 'tags', then the Vocabulary section does not display in Vertical tabs. If I change one of the vocabularies to 'multiple select' then the vocabulary NOW shows up in Vertical tabs.

This was performed on a new install of D6.17 with nothing else installed other than Vertical Tabs.

Can anyone else confirm that this really is happening??

Comments

hefox’s picture

Is the vocabulary section actually a fieldset when all tags? Doubt it

  // if tag, structured like that
  $form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield',
  
  // if other, structured like this
  $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, array_keys($default_terms), filter_xss_admin($vocabulary->help));

  // this is how taxonomy figured out it needs a fieldset
      if (count($form['taxonomy']) > 1) {

so no matter how many tags, that'd all be under 'tags', aka counting as one. adding the mutli select brings up count($form.. ) to 2, ie making it a fieldset. Vertical tabs works on fieldsets.

hook_form_alter $form['taxonomy'] into a fieldset and it should work :).

Or if the site doesn't have much content, you could try out content_taxonomy (taxonomy cck field) and fieldgroups.

gausarts’s picture

Confirmed, same behavior for tags only, no fieldset, no vertical tabs.

hefox’s picture

Category: bug » support
Status: Active » Fixed

Hm, being that it's not vertical tabs fault, as vertical tabs works as designed, and it doesn't seem like something vertical tabs should be changing?, marking it as fixed support request. Of course, re-open if ya disagree.

dave reid’s picture

Yep, you got the same behavior for taxonomy fields in D7 before they were converted to entities.

mkinnan’s picture

Then does the problem actually lie with drupal core? So, if I had 2 or more 'tag' vocabularies, drupal core should recognize the vocabulary section as a fieldset but it doesn't. Then this causes vertical tabs not to recognize the vocabulary section. Is that what is happening?

dave reid’s picture

If you have multiple tag vocabularies, taxonomy.module puts them in $form['taxonomy']['tags'][vid]. All other vocabularies go into $form['taxonomy'][vid]. So if you have two tag vocabularies, count($form['taxonomy']) is not > 1.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

giorgosk’s picture

Title: Vocabulary Element Does not Appear in Vertical Tabs » Allow Any 2 Vocabularies to be able to form a vertical tab
Category: support » feature
Status: Closed (fixed) » Active

is there any reason why we can't be a little flexible
and allow any two vocabularies (TAG or NOTAG) to be in a vertical tab ?

I am running in a situation where I have 6 TAG vocabularies that can't get in their own vertical tab and clutter the interface

of course there is workarounds like taxonomy_role or taxonomy_defaults and creating one extra NONTAG vocabulary that users can't access or can't see (respeectively) but ... why is't vertical tabs provide such functionality ?

dave reid’s picture

Category: feature » support
Status: Active » Closed (fixed)

It's controlled by core. It shouldn't be vertical tabs job to 'fix' core. Just convert fieldsets.

amanire’s picture

The Content Taxonomy module should be a viable workaround if you don't mind adding an extra CCK field and db table. You just need to to put the corresponding taxonomy CCK field in a group for it to appear as a fieldset.

giorgosk’s picture

Another workaround would be http://drupal.org/project/content_taxonomy_term_list
but I still would prefer this feature from vertical tabs since the workarounds have their limitations

julianmancera’s picture

Hi all,

Is there any coding fix for this isuue, I just try with the hook_form_alter to change the taxonomy to a fielset:

$form['taxonomy'] = array(
        '#type' => 'fieldset',

        '#title' => t('Category'),
        '#collapsible' => 1,
        '#collapsed' => 1,
      );

It does convert the taxonomy into a vertical tab but the category selector disapears, not sure why. I compared my form array with one that already has the vertical working and it is the same but the vocabulary content is not rendered.

Any ideas?

Thank you

Julian Mancera

julianmancera’s picture

I found it you should make a custom module and in a hook_form_alter put

$form['taxonomy'] += array(
          '#type' => 'fieldset',
          '#title' => t('Vocabularies'),
          '#collapsible' => TRUE,
          '#collapsed' => FALSE,
        );

Julian Mancera