I built a site in D6 with a view that had one set of exposed filters in multiple blocks on different pages. (www.bigmangoproperties.com property search block in left sidebar)

One block was placed on the home page and redirected the Views search results to another page, the view page display. That search results page also had the other indentical filter block in the same sidebar.

I am rebuilding the site in D7 with Panels (trying not to use the block system at all) using panel panes in Views but it fails because Views and Panels don't talk to each other enough to know that an exposed filter in a panels pane should redirect to another panels page where the same filter is in a pane and the view in another pane.

Having the exposed filters in a panel pane on the same page as the view (also in a views panel pane) is easy to do (see #419556: Make 'exposed form in block' work in panels: Change the $form['#action'] of views_exposed_form to request_uri() in panels_pane, comment 21 by Merlin) but I can't figure out a way to use multiple exposed filters in panels panes on different pages redirect to the same view using panels panes.

Using a Views page display doesn't help either because Panels cannot override a Views page.

Seems like this would be a fairly common use case that begs a generic solution. I don't want to resort to using the block system - trying to use only Panels and Panels Everywhere for all new sites.

The answer could be something as simple as having a Views context available to the exposed filter to know where to redirect.

Before I write a custom module to fix this I thought I'd ask around...

Comments

merlinofchaos’s picture

Why does changing the #action not work in this case? I don't understand what's not actually working for you.

merlinofchaos’s picture

In fact, where the exposed filter actually goes to has nothing to do with Panels at all, really, so I think your base assumptions about what isn't working may be incorrect.

druplicate’s picture

Thanks for the prompt reply!

I want a view's filters exposed in a block on two different pages in panels panes to redirect to a panels page where the view results are in a views panel pane. One of those filters blocks just happens to be on the same page as the views results pane. There doesn't seem to be any obvious way to do this through the UI, or else I'm missing something.

You're suggesting I do something like this?

<?php
function hook_form_alter(&$form, &$form_state, $form_id) {  
  if ($form_id=='views_exposed_form') {
    global $base_url;
    $form['#action'] = $base_url.'/path_to_panels_page_with_view_results_in_panel_pane'; 
  }
}
?>