开发者

Drupal: Can I avoid forwarding after content is created / saved?

开发者 https://www.devze.com 2022-12-22 01:32 出处:网络
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 compl

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消