Hello,

Thanks for this module, it's really usefull. I hope you don't mind me asking for a new feature but I have been trying to get my head around this for two days now and I'm stuck.

I want to create a view that lists all the nodes that have used the address field.
This works great.
I would like now to create and exposed filter that allows the user to filter the results by "country".
As it is I get the possibility of using a "text field" search query that takes the two letter ISO code for the countries.
Is it possible to have a select list on the country field for the exposed filter?

I've been looking at the code and I suppose that what is needed is to be able to hook the function _addressfield_country_options_list() function into the view filter... but i haven't go the faintest idea of where to begin.

Comments

apprentia’s picture

I'm still trying to get this to work. I don't have the coding credentiels to really understand what's happening there... Is there anyone who can point me in the right direction?

manu manu’s picture

Alas I don't think it's possible out of the box right now.

Looking at a similar module, Location, there is a bunch of views related files and specifically location_handler_filter_location_country.inc witch constructs a select. Address Field doesn't have such views integration.

I don't know is this feature is planned...
This issue seems similar: #991834: Address component Views support

elly’s picture

I am in need of this too. Any news or thoughts from the maintainers on this? I can't bear the thought of going back to location.module for this functionality. I like where addressfield is going and have it working great with an openlayers map & geofield!

damien tournoud’s picture

Status: Active » Fixed

This has been implemented in #0570b0d!

elly’s picture

Wait. Should I be seeing the fix in alpha 4? I just updated and still don't see country filter select lists available in views?

damien tournoud’s picture

Nope, it's only in the -dev currently. Should make it to the release today.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

emptyvoid’s picture

Chuckle, looks like it never got into an official release. :(

So it looks like there isn't standard functions to generate administrative_area values either, let alone expose it as a filter in Views.

dshields’s picture

Using the same concept for administrative area would have tremendous value as well

stewart.adam’s picture

I would appreciate this as well, it would be very great to have a drop-down selection of states/provinces, even better if it has an option to limit the possibly options to the ones available in the query results.
Edit: Sorry, posted this to the wrong tab. Was supposed to go to the corresponding issue for administrative area.