Quantcast
Viewing latest article 7
Browse Latest Browse All 8

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


Filed under: CMS Tagged: Drupal, Drupal Development, Panels, Postaday2011, Views Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing latest article 7
Browse Latest Browse All 8

Trending Articles