I would like to know if it is possible to insert a node in a page. I work with Drupal 7 and I can not find how to do this.
Someone has an idea? I tried to do this:
function test(){
if (!function_exists('node_add')) {
module_load_include('inc', 'node', 'node.pages');
}
print drupal_render(node_add('node_example'));
}
My form is displayed but poorly. It is “on” my theme
I hope I am understanding your question correctly. The answer to my comment did help! If it is a node form that you’re trying to add to the menu, this is typically done with a hook_menu() function in Drupal. Here is some sample code to get you started
Remember to clear your cache before you test it!
Sample code in your function that is creating the form:
See if you can see this tiny one-field form to get you started. This doesn’t explain how to actually save the user data, etc because that is outside the scope of what a single answer here can provide, but this should help you get started on a form that’s hooked up to the menu system….
I hope this helped!!!!
=================== EDIT ===================
Here is online documentation for the different types of form elements you can add to forms in Drupal: http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7