rockstardev
rockstardev

Reputation: 13537

Embed node creation form using PHP

I have a content type called "enquiry". I want to embed the node creation form at various places throughout my website. How do I do this via PHP?

Upvotes: 0

Views: 379

Answers (2)

rockstardev
rockstardev

Reputation: 13537

Solution:

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

Upvotes: 0

Deric Braito
Deric Braito

Reputation: 11

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

Upvotes: 1

Related Questions