views:

1103

answers:

1

Hello,

I'm a drupal newbie (but experienced with PHP). I've created some functions to display pages and mapped them onto urls using menu functions.

In one of these functions, I'd like to grab a form for a CCK content type, have my way with it, and spit it out onto a template.

So I have a function projectadmin_create_page(), which grabs a reference to the form using:

$form = drupal_get_form('project_node_form'). Here I'd like to alter it (or create a new form based on it) and send it off to the template. As a first step, I'm passing it straight to the template. Here, the form tag along with all the hidden fields get output, but none of the field tags.

My hope was that I wouldn't have to rewrite all the validation for the CCK form, but still get a custom page.

Can anyone provide some guidance?

+1  A: 

you can alter any Drupal form with hook_form_alter [1, 2]

ax
But I'm trying to split a CCK form into parts. So if I write project_form_alter(), and remove a bunch of fields, that will happen everytime I want to display that form, wont it? I want to grab the form, take half of it, spit it out on one page. Take the other half and spit it out on another page.

related questions