1

尝试在新的内容类型添加表单中添加一些额外的表单项。

也尝试增加提交和预览的权重。

function mymodule_form_alter(&$form, &$form_state, $form_id){
  //add some $form items here

  $form['actions']['submit']['#weight'] = 2000;
  $form['actions']['preview']['#weight'] = 2001;
}

但不知何故,提交和预览按钮仍然位于那里添加的新项目上方。

4

1 回答 1

4

尝试将#weight属性添加到$form['actions']包装器。

您当前的代码更改了 2 个按钮的权重actions wrapper,并且不会影响包装器的权重。

例如看下面的代码:

function mymodule_form_alter(&$form, &$form_state, $form_id)
{
    //add some $form items here

    $form['actions']['#weight'] = 2000;
}

希望这有效。

于 2013-03-18T08:37:57.930 回答