Put a node submit form in a block In Drupal 7, I have defined a block called mycontenttype_block. I would like the output of the block to be the node submit form for an existing content type, like this:

function mymodule_block_view($delta = '') 
{
    switch ($delta) 
    {
        case 'mycontenttype_block':
            $block['subject'] = t('Mycontenttype submission form');
            $block['content'] .= $something;
            return $block;
            break;
    }
}


Where $something is the form output. I tried setting $something to drupal_get_form('mycontenttype_form) but I can't get any output...
Here in drupalsixlandia, I wanted to have this on a different page and did something along the lines of this to get it to work:

global $user;

module_load_include('inc','node','node.pages');
$type = 'TYPEOFNODE';
$node = array('uid' =&gt; $user-&gt;uid, 'name' =&gt; $user-&gt;name, 'type' =&gt; $type, 'language' =&gt; '');

return drupal_get_form($type .'_node_form', $node);


so perhaps D7 needs a similar $node argument as well.

ADDITION:  a quick look suggests D7 wants $node to be an object, not an array and does it by just doing:

$node = (object) array('uid' =&gt; $user-&gt;uid, ...


You might be able to grab its code directly and use it.  Looking back, I don't know why I just didn't grab this from node.pages.inc directly myself:

/**
 * Returns a node submission form.
 */
function node_add($type) {
  global $user;

  $types = node_type_get_types();
  $node = (object) array('uid' =&gt; $user-&gt;uid, 'name' =&gt; (isset($user-&gt;name) ? $user-&gt;name : ''), 'type' =&gt; $type, 'language' =&gt; LANGUAGE_NONE);
  drupal_set_title(t('Create @name', array('@name' =&gt; $types[$type]-&gt;name)), PASS_THROUGH);
  $output = drupal_get_form($type . '_node_form', $node);

  return $output;
}


Ah...here's why.  I didn't like the title, and I doubt you want that if you are stuffing this in a block :)