Is there a setting / module that will automatically redirect a user back to "?q=node/add" after he/she submits content. Currently the user is left viewing the content and has to click create content again to add more content.

Comments

RobRoy’s picture

You should be able to do something like this...just jotting it down real quick.

/**
 * Implementation of hook_form_alter().
 */
function mymodule_form_alter($form_id, &$form) {
  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
    $form['#redirect'] = 'node/add;
  }
}

You could do stuff with type in there too by checking $form['#node']->type.

JHDYCompany’s picture

Would this be for all content types?
Where would I implement this? How?

RobRoy’s picture

By creating a custom module. This would be for all node types. You should really check out the handbook for module development and the like as it appears there are some basics you still need to learn. :)

JHDYCompany’s picture

Status: Active » Closed (fixed)