Drupal: Can I avoid forwarding after content is created / saved?
Can I avoid forwarding after content is created / saved ?
I don't want to display the node after user click on "Save开发者_运维百科"
The generic approach to control the redirection after form completion is to overwrite the forms '#redirect' value in a custom hook_form_alter()
implementation.
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.
精彩评论