Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }

Still it is bad practice to inlcude php in your views header. You should implement a custom area handler.

  1. How to create a view area handlerHow to create a view area handler
  2. https://api.drupal.org/api/views/handlers!views_handler_area.inc/group/views_area_handlers/7
  3. https://oliverhuynh.wordpress.com/2011/06/23/custom-views-handler-drupal-7-template/

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }

Still it is bad practice to inlcude php in your views header. You should implement a custom area handler.

  1. How to create a view area handler
  2. https://api.drupal.org/api/views/handlers!views_handler_area.inc/group/views_area_handlers/7
  3. https://oliverhuynh.wordpress.com/2011/06/23/custom-views-handler-drupal-7-template/

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }

Still it is bad practice to inlcude php in your views header. You should implement a custom area handler.

  1. How to create a view area handler
  2. https://api.drupal.org/api/views/handlers!views_handler_area.inc/group/views_area_handlers/7
  3. https://oliverhuynh.wordpress.com/2011/06/23/custom-views-handler-drupal-7-template/
added 676 characters in body
Source Link
Robin
  • 2k
  • 2
  • 14
  • 23

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }

Still it is bad practice to inlcude php in your views header. You should implement a custom area handler.

  1. How to create a view area handler
  2. https://api.drupal.org/api/views/handlers!views_handler_area.inc/group/views_area_handlers/7
  3. https://oliverhuynh.wordpress.com/2011/06/23/custom-views-handler-drupal-7-template/

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }

Still it is bad practice to inlcude php in your views header. You should implement a custom area handler.

  1. How to create a view area handler
  2. https://api.drupal.org/api/views/handlers!views_handler_area.inc/group/views_area_handlers/7
  3. https://oliverhuynh.wordpress.com/2011/06/23/custom-views-handler-drupal-7-template/
added 266 characters in body
Source Link
Robin
  • 2k
  • 2
  • 14
  • 23

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

You could to use hook_form_FORM_ID. Something like this:

function mymodule_form_page_node_form_ater(&$form, &$form_state, $form_id){
   if(current_path() == 'page/where/my/view/is'){
     $form_state['redirect'] = 'page/to/redirect';
   }
}

If you don't want to use a hook, you can do something like this:

 $edit_page['buttons']['submit']['#submit'][] = 'redirect_submit';

Then,

 function redirect_submit($form, &$form_state){
  $form_state['redirect'] = 'path/to/rediect';
 }
Source Link
Robin
  • 2k
  • 2
  • 14
  • 23
Loading