0

I have installed Event module which gave me an "Event" content type.

I want to theme the node edit/creation form for the Event content type that automatically comes once the Event module is enabled.

I have tried defining the custom tpl to handle but it's not working. Any help would be appreciated.

Thanks.

1 Answer 1

1

It all depends on what changes you want to make, but the standard way of altering forms in D6 (and D7) is invoking hook_form_alter() in a custom module. Do a switch on the form_id, and enter your edits, something like this:

YOUR_MODULE_form_alter(&$form, &$form_state, $form_id) {
  // print $form_id; exit;
  switch($form_id){
    case 'event_node_form':
      // change the form. The following will alter the text on the submit button:
      $form['submit']['#value'] = 'Go!';
      break;
  }
  return $form;
}

If you don't know what the form_id is of the form you want to edit, just uncomment the print $form_id line and visit the form in your browser. You can refer to the D6 form api guide to find what form elements go with which properties. Hope that helps!

1
  • Hey thanks, there was some issue with my template definition and template handling code in template.php . After a few fixes it worked. Anyways thanks for your answer too @olyN Commented Feb 26, 2014 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.