1

When editing some fields, after I click the save button, I want the page to redirect to a particular page. Is there any module for this requirement?

4

check the module Node save redirect

This module provides a method of specifying a location to take the user after saving a piece of content. A set of radios buttons are added to the submission vertical tab on the content type edit form. The available options are. Default - Default behaviour Return to Edit page after saving Return to content overview page (assuming the user has access permissions Re-redirect to another location. (any valid drupal path)

6

Another approach is to simply implement hook_form_alter and put this code into it:

    function MY_THEME_OR_MODULE_form_alter(&$form, &$form_state, $form_id) {
      // dpm($form_id)
      // dpm($form)
      if($form_id == 'article_node_form') {
        $form['actions']['submit']['#submit'][] = 'my_node_form_submit';
      }
    }

    function my_node_form_submit($form, &$form_state) {
      $form_state['redirect'] = 'MY_URL';
    }
4

You can use rules. Go to admin/config/workflow/rules. Add a new rule enter image description here-

react on event = saving new content.

enter image description here

Specify the content type this rule will work on.

enter image description here

Add an action to the rule -

enter image description here

in this case redirect page (under system - page redirect) -

enter image description here

and then add in the url of the redirect or use tokens. Plus rules has the added benefit of being useful for other things than just redirects.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.