I need to add a form to ALL node types edit page "?q=node//edit"? Just as you would using hook_form().

Ideas?

Comments

therealwebguy’s picture

Just use a form_alter hook. It would look like this.

Create a new module called "my_form_controller.module" and inside of it add this.

function my_form_controller_form_alter($form_id, &$form) {
  switch ($form_id) {
    case 'node-form':
      // Add your new form values here. Lets say you wanted to add a new text box for a custom title.
      $form['custom_title'] = array(
        '#type' => 'textfield',
        '#title' => t('Custom Title'),
        '#weight' => -20,
        );
      break;
  }
}

This will create a new text field with a title of "Custom Title" at the top of every node/ /edit form. Hope this helps.