tags:

views:

35

answers:

2

Can I avoid forwarding after content is created / saved ?

I don't want to display the node after user click on "Save"

A: 

Yes, using hook_nodeapi() in a custom module you can put in a alternate behaviour when $op == 'insert', as per below:

function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'insert':
        drupal_goto('somewhere_else');
      break;
  }
}

Note: Code is off the top of my head, so take it for the concept.

Decipher
While this would probably work in the requested context (node insert), there is a more generic approach that can be applied for arbitrary forms - see my separate answer for this.
Henrik Opel
+1  A: 

The generic approach to control the redirection after form completion is to overwrite the forms '#redirect' value in a custom hook_form_alter() implementation.

Henrik Opel

related questions