I'm trying to create a search facility which mirrors the functionality found here: http://www.independentmidwives.org.uk
(type your postcode into the 'Find your nearest midwife' box at the top of the screen to see the results page, or try OX13 6BW if you're not familiar with UK postcodes!). Essentially, it's a search results page which shows a map of results at the top, and a list/table view of the same results directy underneath.
By combining Views, Views_FastSearch, Location, and GMap, I've so far managed to create a view with the 'location: proximity' as an exposed filter. I also have two additional exposed filters in this view to select the node type and a search term. This view is set to type GMap and presents the results in a map which works for the top half of the results page.
I've then cloned this view, but set it to be view type 'table' - again, this works nicely to provide the bottom-half list.
Now to show the list view underneath the map view....
I have tried to embed a call to views_build_view the list view in the footer of the map view (using the technique described at http://drupal.org/node/42599#comment-105738), and make them share the same arguments by using the argument handling code. The problem is that neither the 'location: proximity' nor 'search term' are arguments - they are only filters.
Is there any way I can expose these as filters in one view, but then pass whatever filter parameters were chosen onto the second view? (Or is there a different way to go about this altogether?)
Any help gratefully received.
Comments
Comment #1
EvanDonovan commentedIf the views are pulling information from the same dataset, you might be better off using a Table + GMap theme function. See if http://drupal.org/node/123601 provides the functionality you're looking for.
Hope that this isn't a dead issue :)
Comment #2
merlinofchaos commentedThe final argument to views_build_view(),
$filterscan be an array. Simply pass the filters the filters in.The real trick is that you have to expose the filters in both views; but you can use theming to prevent the filters from displaying. I wrote an article on angrydonuts.com last year about doing this kind of thing.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
faulkner161 commentedHello, this is the sort of functionality that I am looking for on my own website. I have been looking at adapting phpGoogleStoreLocator (crystaldawn.net), or at least waiting until the developer makes the module more compatible with Drupal. Am I right in thinking that you managed to achieve a map of locations which allowed a proximity search; and even more importantly, was this done in the UK? If so, would you mind assisting me on developing this idea or giving me an idea on how you got this to work with the modules you mentioned. Any help, would be greatly appreciated.
Many Thanks,
Simon.