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.

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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