开发者

Embed node creation form using PHP

开发者 https://www.devze.com 2023-01-09 23:49 出处:网络
I have a content type called \"enquir开发者_如何转开发y\". I want to embed the node creation form at various places throughout my website. How do I do this via PHP?sounds like a job for the webform mo

I have a content type called "enquir开发者_如何转开发y". I want to embed the node creation form at various places throughout my website. How do I do this via PHP?


sounds like a job for the webform module. if you really want to go the cck route you can try something like this:

$node = new stdClass();
$node->type = 'store_review';
module_load_include('inc', 'node', 'node.pages');
$output = drupal_get_form('store_review_node_form', $node);
print $output;

ref: http://drupal.org/node/464906


Solution:

$node = new stdClass();
$node->type = 'enquiry';
module_load_include('inc', 'node', 'node.pages');
$output = drupal_get_form('enquiry_node_form', $node);
print $output;
0

精彩评论

暂无评论...
验证码 换一张
取 消