By panhongwei on
I create a page , the input format is php code .
content:
global $user;
$type ='page';
$types = node_get_types();
$nodex = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));
$output = drupal_get_form( $type . '_node_form', $nodex);
echo $output ;
But view it , show:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'node_form' was given in C:\wamp\www\projects\drupaltest\includes\form.inc on line 366.
How can I get create content form in my custom page ?
Comments
I don't know...
...but if it helps, your code works flawlessly on my site.
What drupal version ? thank
What drupal version ?
thank you?
6.4
6.4
node.pages.inc
You need to include node.pages.inc before you can call drupal_get_form($type ...); as the form builder (node_form) and a lot of other important node form functions are in that file.
Then a general tip: make a custom module to hold this code and minimize the use of PHP nodes.
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
Thank you, Heine
This has solved my prob, too!
I can't run it . Please show
I can't run it .
Please show your code , thank you!
I believe Heine is referring
I believe Heine is referring to;
module_load_include('inc', 'node', 'node.pages');
use this before you make your call to drupal_get_form
I can run it ! Thank you
I can run it !
Thank you very much!
<? $new_blognode = new
works for me!
all the best
Lukas
--
www.netnode.ch