R – Drupal 6: Altering a CCK form on a page created by the menu system

cckdrupaldrupal-6formsmodule

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?

Best Answer

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

Related Topic