[development] Get the form for a node
Jamie Holly
hovercrafter at earthlink.net
Mon Jun 13 00:33:23 UTC 2011
Actually it's:
module_load_include('inc', 'node', 'node.pages');
$form = drupal_get_form($node->type .'_node_form', $node);
[OR]
$form = node_page_edit($node); // This will also set the page title with
the node title
Make sure to load the node.pages.inc file so that everything
Jamie Holly
http://www.intoxination.net
http://www.hollyit.net
On 6/12/2011 8:24 PM, Ms. Nancy Wichmann wrote:
> You can look at the node.module (probably actually node.pages.inc?)
> and get the form name, but I think it is actually "node_form_/type./"
> And I believe you'll need to recast the object to an array. Something
> like,
>
> $form = drupal_get_form('node_form_article', (array) $node);
>
> /*Nancy*/
>
> Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L.
> King, Jr.
>
> ------------------------------------------------------------------------
> *From:* Fernando Conceição
>
> I have searched a lot, but dont find the right way to do this.
> So what i want is to load the form for a node, the same form as if
> i am editing a node, something like:
>
> $node = node_load(1);
> $form = drupal_get_form('article_node_form', $node);
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110612/085acd19/attachment.html
More information about the development
mailing list