Drupal 7 Drupal7:如何动态绘制节点添加表单的所有小部件
我正在开发一个模块,在该模块中,我需要在同一页面中绘制来自不同内容类型的多个节点添加表单,并一次性保存它们。我有我需要添加的每个节点的所有内容类型,我甚至使用Drupal 7 Drupal7:如何动态绘制节点添加表单的所有小部件,drupal-7,content-type,drupal-hooks,Drupal 7,Content Type,Drupal Hooks,我正在开发一个模块,在该模块中,我需要在同一页面中绘制来自不同内容类型的多个节点添加表单,并一次性保存它们。我有我需要添加的每个节点的所有内容类型,我甚至使用field\u info\u实例(“node”,$type)来获取字段 现在我需要渲染字段。我找到了node\u add(),但是这个函数创建了整个表单,包括保存按钮和发布选项。我只需要字段的小部件 drupal中是否有一个钩子或函数,在给定内容类型的情况下,只呈现节点添加表单的小部件,甚至在给定字段信息的情况下呈现字段的小部件 R PS:
field\u info\u实例(“node”,$type)
来获取字段
现在我需要渲染字段。我找到了node\u add()
,但是这个函数创建了整个表单,包括保存按钮和发布选项。我只需要字段的小部件
drupal中是否有一个钩子或函数,在给定内容类型的情况下,只呈现节点添加表单的小部件,甚至在给定字段信息的情况下呈现字段的小部件
R
PS:我正在Drupal7.x上工作调用node\u add($content\u type);将为您提供此特定表单类型的节点添加表单
我想是这样的
$form = array();
$types = array('page', 'blog', 'article');
foreach ($types as $type) {
$type_form = node_add($type);
// Somehow merge this data with the $form array avoiding the conflicts
// resulting from mulitple fields with same name.
// and find a way to submit all of them with one button .. ajax?
}
return $form;