Closed (fixed)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Jun 2012 at 09:37 UTC
Updated:
14 Nov 2013 at 01:57 UTC
Jump to comment: Most recent
Comments
Comment #1
Golem07 commentedYou could try the excellent Location Taxonomie module. I would but it does not support Profile or Profile2 entities (yet).
Comment #2
halefxI'm in the exact same situation. Did you ever resolve this?
Comment #3
mrweiner commentedI ended up doing it with a combination of Search API and Views for now. Check out my post, #15, at https://drupal.org/node/1269608. You'll need to set up your search index (for which you can find a bunch of tutorials online) and then add all of your address field parts into an aggregate field. From there you can follow my directions in that post and use the code for a custom module to help out your search results with regard to searching for California vs. CA.
Comment #4
halefxThanks for the follow-up
Comment #5
mrweiner commentedComment #6
morbiD commentedThis really seems like an obvious feature for basic views integration to me so I was surprised to find it wasn't possible.
I mean, if somebody is setting up a view that includes address data and wants an exposed "Contains" filter to allow address searching, I imagine they aren't going to want separate filters for each component of the address.
Maybe it's more difficult to implement than it sounds, but perhaps this can get some attention as a feature request.
Comment #7
hoff331 commentedI agree 100%, the fact that this not out of the box is mind boggling. I switched to OpenLayers from Get_Locations on a side project just for fun... Get_locations comes with this functionality out of the box. Seems like I might switch back.
********************EDIT TO THIS STATEMENT**********************
This is SOMEWHAT possible out of the box... add an exposed filter using the field "Address:locality". It provides a text box that only works on City (ie. you cannot search country, zip, street address, etc). I assume the other fields Address:Zip, Address:Country, etc only work on their relative values.
Also, the text field is NOT case sensitive!
----
My views are set up with the openlayers master view and openlayers map page view all in the same View set. The exposed filters are set to display on all views (master, pages, blocks, etc).
Comment #8
morbiD commentedI've figured out a way of achieving this using an additional module but it makes the whole thing a lot more complicated than it should be, and requires Views 3.4 or higher:
This seems to work for me, but it's not ideal. It would be far more user friendly for this module to supply its own filter.
Edit: I suppose an alternative to a "Whole Address" filter would be to provide fields for each address component, so that the "Global: Combine fields" filter could be used as above, without the requirement for the views_field module.
Comment #9
rszrama commentedThis isn't in here already because it's a non-trivial feature to add. Doesn't boggle my mind. : P
Just look at how the core Views "Combine fields filter" gets it wrong. (Hint: it only ever searches on the first column of a field, i.e. the address's country.)
I think it's a fine feature request, but I'm going to re-title it.
Comment #10
lmeurs commentedIt would be super if Addressfield supported combined search in Views! +1
Comment #11
xmacinfoI will try solution in #8.
But I also agree that Addressfield should be more friendly to Views exposed filter.
Comment #12
xpersonas commentedThis was a shock for sure. #8 saved me. Views Field module is awesome!
Comment #13
gettysburger commentedI tried #8 and it worked great for me except for the State (administrative) field. Any ideas? I even tried the Sub Administrative Area.
Comment #14
rszrama commentedDid it not work for you w/ State because you were searching by the full name? Bear in mind the Views filter is searching data, and States would actually be stored as abbreviations.
Comment #15
gettysburger commentedThanks. Yeah, it was the state abbreviation that got me.
Comment #16
rszrama commentedNow that #991834: Address component Views support has landed, I'm not sure we need to do anything else here, do we? I created a local test that added the individual address components I wanted to search on as hidden fields, and I was able to create an exposed filter that combined the values of those Views fields for filtering the result set. Worked as expected, though as mentioned above, you have to watch out for administrative area abbreviations vs. full names.