Drupal – Form Path Problem of Exposed Filter Block in Panel Page

In Views, we can make the exposed filter into block and therefore we can select it for Panel page. But this would not work because after the filter form submission, it will redirect to the view page rather than the current panel page.

Luckily, i found a solution to resolve the issue.

<?php
function <module>_form_alter(&$form, $form_state, $form_id){
  if ($form_state['view']->name == 'VIEW_NAME' && $form_id == 'views_exposed_form') {
    $form['#action'] = '/panel/path';
  }
}
?>

 

Now it will stay at the /panel/path after the filter form submission.

Done =)

Reference: Make ‘exposed form in block’ work in panels: Change the $form[‘#action’] of views_exposed_form to request_uri() in panels_pane
http://drupal.org/node/419556

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.