[development] Get the form for a node

Ms. Nancy Wichmann nan_wich at bellsouth.net
Mon Jun 13 00:40:27 UTC 2011


Thanks, Jamie. That's why I try not to code off the top of my head, or after a very eventful day.
 
Nancy

 
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.



>________________________________
>From: Jamie Holly <hovercrafter at earthlink.net>
>To: development at drupal.org
>Sent: Sunday, June 12, 2011 8:33 PM
>Subject: Re: [development] Get the form for a node
>
>
>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/afed01fe/attachment.html 


More information about the development mailing list