I want to load the same forms as /node/content_type/add fields into my page. It will be used for dragging and dropping content types into a div that then displays their edit forms and, after the forms are completed, new nodes are created for each content type. my module keeps track of the order and nid of the newly created nodes.

I've tried to figure out how to get the rendered forms but am really stuck. Does anyone know how to do it?
Thanks for you help!

Comments

myriad’s picture

How can I get the html-ized forms from a node edit form?

joshmiller’s picture

I'm looking into this...

My first thought was


$content_type = "calendar_event"; // machine readable name
drupal_get_form($content_type.'_node_form');

But I get the following error:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'node_form' was given in /var/www/vhosts/stecalendar.com/httpdocs/includes/form.inc on line 366.

I'll let you know what I find.

MJ

japanitrat’s picture

<?php

// load include file for node pages
module_load_include('inc', 'node', 'node.pages');

// get the creation form of your_content_type
$form = node_add('your_content_type');

// print it to the output
print $form;

?>