views:

1307

answers:

5

I have four block views on a page (call it "info" page) that are filtered by proximity to give me four pieces of information relating to one particular filtered location.

I would like to be able to create an intro page with an exposed proximity filter that when executed would take me to the (info) page and simultaneously filter the four views with the proximity entered on the intro page.

How can I do this? I am new to php but learning .... willing to work at it!

Thanks

+1  A: 

If you're using Views in Drupal 6, the answer is yes -- with some important caveats.

Unlike normal forms in Drupal, Views' exposed filter values come in as $_GET params raher than $_POST. That means that you can populate an exposed filter just by appending ?filter=value&filter2=value2 etc... to the current URL.

The kicker is that if multiple views on the same page are looking for the same filter keys in the URL, they will both use the incoming filter value. You'll need to configure each view's list of exposed filters to make sure that they all user the same list of filters, with the same list of 'keys' for the incoming values. If you want the filter form to only appear once, you may have to do some crafty juggling as well--Views will want it to appear on each view by default, but there's an option on each view to move its exposed filters to a block; doing that and NOT enabling the exposed filter block effectively hides the view's exposed filter widgets, while keeping the filtering active if it comes in via the URL.

To summarize: make sure all four views have the same list of exposed filters, and are using the same 'keys' for the filters. Hide the exposed filter widgets on all but one of the views. At that point, it should work.

Eaton
Eaton,Thanks for your quick response. I believe I understand but not sure how to implement. Before going any further...can this be done with Views in Drupal 5.x? I am kind of locked-in to 5.x at the moment because of non-availability of some modules in 6.x.Jeff (jdm843)
Exposed filters still work in D5, but you have to be a lot more careful: they use keys like 'filter1' and 'filter2' -- which means that you need to keep all of the filters for th different views in sync so that URL keys match. if you do that, it should still work!
Eaton
A: 

how do you place the views on the same page? using panels?

A: 

to insert views anywhere you can use input formats http://drupal.org/project/insert_view

A: 

Hi Eaton,

Thanks for this. I'm trying to implement this and having a little difficulty with the URL. I have a block with multiple exposed filters. After the user has entered their search criteria I would like to pass the values of the exposed filters to another View (page view)via the url. Can you give me an example how I can do? (I know there is a "More Link" that you can generate but when using a block and exposed filters it doesn't work well with the Ajax on the paging element).

Any help would be most appreciated.

Thanks Angie

Angie
A: 

Hi,

Is there a good tutorial about how to do this in Drupal 6?

David