Hi

I try to use the "hook_form_FORM_ID_alter" in my theme called "sds". It seems not to fire?

I Register the hook.

function sds_theme() {
return array (
'form_news_node_form_alter' => array(
'arguments' => array('form' => NULL),
)
);
}

And the a test (form id is news_node_form, a cck field).

function sds_form_news_node_form_alter(&$form, &$form_state) {
print_r($form);
}

Nothing happends, please som advise?

regards // Johannes

Comments

asiby’s picture

You should use that hook in a module, not in a theme.

Live long ... and prosper!

ishmael-sanchez’s picture

You can use hook_form_alters in Drupal 7 themes, but I think in D6 you are stuck writing a simple module. Once you have your module folder and info file created create your .module file and add this

// This function fires on page nodes. Change 'test' to the name of your module
function test_form_page_node_form_alter (&$form, &$form_state, $form_id) {
  dsm($form); // If the devel module is installed you can use this for debugging
}