Drupal自定义设置不会保存

时间:2015-01-23 02:49:58

标签: drupal drupal-7

好吧所以我对Drupal来说是个坏人......就像今晚的新人一样。我无法弄清楚这段代码不会保存的内容。

function custom_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'page_node_form') {   
    $form['custom'] = array(
      '#type' => 'fieldset',
      '#title' => t('custom title'),
      '#weight' => -99,
      '#group' => 'additional_settings',
    );
  $form['custom']['custom_field'] = array(
      '#type' => 'textfield',
      '#title' => t('Use this setting instead'),
      '#default_value' => '',
      '#description' => t('custom field'),
    );
  }
}

我错过了一个挂钩或什么东西可以存钱吗?我假设有人知道drupal知道我在哪里尝试添加这个,但以防万一我想在你去编辑页面时将其添加为自定义选项卡分组。就像它说菜单设置,修订信息等...

-----------编辑---------

所以看起来我必须添加这行代码

$form['#submit'][] = 'custom_node_form_submit';

0 个答案:

没有答案