Hello!

I need to get the node creation form with drupal_get_form.
But every time I get empty array.
I have tried several solurions from forums - but nothing work unfortunately.
For example thi one not working

module_load_include('inc', 'node', 'node.pages');
    $node = $node_form;
    print drupal_get_form('tur_node_form', $node);

Thanks!

Comments

jaypan’s picture

module_load_include('inc', 'node', 'node.pages');
$type = 'some_node_type';
$form = node_add($type);

Contact me to contract me for D7 -> D10/11 migrations.

Spider84’s picture

Thanks, it works!