4
如何以自定义Drupal形式添加分类术语参考字段
菜单项定义drupal_get_form为回调函数,并从回调函数返回表单。如何taxonomy_term_reference在此表单中添加字段? $items['files/add'] = array( 'title' => 'Add file', 'description' => 'Allows users to add files', 'type' => MENU_CALLBACK, 'page callback' => 'drupal_get_form', 'page arguments' => array('mymodule_add_file'), 'access callback' => TRUE, ); function mymodule_add_file($form, &$form_state) { drupal_set_title("Add file"); $form['mymodule_form'] = array( '#type' => 'fieldset', '#tree' => TRUE, '#collapsable' => FALSE, '#title' …