Programmatically loading a node form

Recently I was attempting to display a Drupal node (CCK) form on a module generated page. Here is a tested and working solution.

global $user;  module_load_include('inc', 'node', 'node.pages');  $node = node_load(array(   'uid' => $user->uid,   'type' => 'yourcck', )); node_object_prepare($node);  echo drupal_get_form('yourcck_node_form', $node);

 

I do not accept cheques, single malt is preferred.

Recommended reading

Design by Jon