I was trying to do the same on drupal 6.x I used to do with drupal 5.x to post a form inside a node. In oder words, to embed a node add form inside the body text area of a page. But I was getting fatal errors. I went to drupal.org site and found out that 6.x doesn't include some files when rendering the pages.
Basically this is what I used to do on Drupal 5.x:
<?php
print node_add('my_content_type');
?> <?php
if( !function_exists("node_object_prepare")) {
include_once(drupal_get_path('module', 'node') . '/node.pages.inc');
}
print node_add('my_content_type');
?> Another alternative:
<?php
global $user;
if( !function_exists("node_object_prepare")) {
include_once(drupal_get_path('module', 'node') . '/node.pages.inc');
}
$type = 'your content type';
// Initialize settings:
$node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');
print drupal_get_form($type .'_node_form', $node);
?>
Post new comment