1
votes

I have a node type 'review' which is attached to two vocabularies and are appearing in a fieldset named VOCABULARIES in the node form. But what i don't want them to be in a fieldset. I am using the function in a module and have also increased the module weight but no success till now. Can any one tell me what i am doing wrong here..?

<?php
function mymodule_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'review_node_form') {
      $form['taxonomy'][2]['#collapsible'] = FALSE;
      $form['taxonomy'][3]['#collapsible'] = FALSE;
    }
  }
?>
1
Looks OK at first sight... are you certain that the form_id is corrrect? Have you checked if $form['taxonomy'] is already present in the form when your form_alter is executed?marcvangend

1 Answers

0
votes

IIRC, the 'taxonomy' entry itself is the fieldset, so you might try:

function mymodule_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'review_node_form') {
    $form['taxonomy']['#collapsible'] = FALSE;
    $form['taxonomy']['#collapsed'] = FALSE;
  }
}

Note that this would only make the fieldset expanded and non collapsible, but not remove it.