How to display node/add/sometype form on another page?

后端 未结 9 974
故里飘歌
故里飘歌 2020-12-07 22:41

The whole problem is following:

Lets say we have Items, Items can have Bids, Items can have Questions and Question can have Answer.

When an Item is displayed

9条回答
  •  醉梦人生
    2020-12-07 23:24

    To get a node edit form, you need to include node.pages.inc.

     $user->uid,
        'name' => (isset($user->name) ? $user->name : ''),
        'type' => $node_type,
      );
      // Invoke hook_nodapi and hook_node
      node_object_prepare($node);
      // Or you can also use an exiting node, for example
      // $node = node_load(123);
      // and the display the form:
      $output = drupal_get_form($form_id, $node);
    ?>
    

提交回复
热议问题