Drupal node form customization
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.
精彩评论