开发者

Drupal node form customization

开发者 https://www.devze.com 2022-12-22 19:01 出处:网络
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

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 ti开发者_如何学编程ll 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;
    }
  }
?>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消