Hi,
I made a location_county module for contrib (it's basically just a copy of location_fax).
I also patched location_views to be able to use county as an argument (this way I can have a directory which sorts through state, county, and city). If you're interested in location_county I'll post the location_views patch as well.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

smitty’s picture

Did you see this: http://drupal.org/node/165834 ?

Jody Lynn’s picture

No I hadn't- thanks. Your approach seems fine but will require writing update code since it changes the location table. Also I would suggest changing the word 'quarter' to 'neighborhood' or 'district' or something else more general to indicate a city's subregion. (I for one have never even been to a city with quarters.) Also whichever approach is used we should update location_views to include the new fields.

smitty’s picture

Thanks for your look at the patch. You are right, a views-integration is necessary.

But before that, I would like to discuss the two approaches.

At the time I wrote my patch, I didn't know anything about the possibility to build a contrib-module, so I didn't. And till today, I am not experienced in that. But I think it is a very good way to enhance the location module with additional fields because – as you said – it is not necessary to change the location module itself. I think this is a very fine approach for “additional” fields like phone and fax.

But I am wondering, if this approach is also the right one for county and quarter (of course we can name that ‘district’ – I named it like this because English isn’t my first language and my dictionary told me: quarter = district in town).
Don’t this fields count to the “core” fields? E.g. you can search in google maps for counties and districts and the google maps geocoder returns them too.
So I think they also should be integrated in the core functionality of the location module such as the functions location_address2singleline and location_map_link (ok, that is not yet included in my patch, but it should be done).
I do not know if it is possible to enhance that functions with the contrib approach?
If it is, your approach sure is the better way and I would be glad if you could provide also a district-module.
If not, what can we do? Do you have the experience to decide this or should we perhaps ask one of the maintainers of the module?

Anyway it would be great if those enhancements would go into the HEAD.

Jody Lynn’s picture

Version: 5.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Needs work

Hi Smitty,

I think your thoughts are exactly right. However I think that before anyone does any more work on this we need input from the maintainers as to whether they would like to include these features and how they would like them. If this work never gets into the module it will seem like a waste.

I found this post http://groups.drupal.org/node/8346 which details the current roadmap of location module, and it does seem that the maintainers are swamped with location issues and may not necessarily consider these new fields a priority, or perhaps they have a plan to make it easy for anyone to add their own fields instead.

Although I've already scratched my client's itch with my county implementation, I could be willing to help out under guidance from a maintainer of what they would like to include.

smitty’s picture

I asked Brandon (bdragon) how we should proceed and here is his response:

"Hold off until I get the elements patch in. I'm removing all of the pre-fapi internal crap with that patch, and am writing a hook to expose all of the behavior to addon modules.

Please track http://drupal.org/node/217512 (It's the master issue for the patch, which is *almost* ready to publish.)"

skyredwang’s picture

FileSize
780 bytes

here is my patch

YesCT’s picture

Status: Needs work » Needs review

This issue needs someone to summary the work that has been done so far and to re-roll the patch against the most recent dev version so it can be tested.

mbinz’s picture

Have there been any updates or alternatives regarding this issue?

jwjoshuawalker’s picture

A project I'm working on has the need for a county field. They also want it to be an autocomplete field and limit the County selection field if a Province has been entered and then possibly limit the City field if a County is chosen.

I was going to create this as an external module, with an include file similar to the location.us.inc and functions to sift through it depending on if a Province has been chosen. My concern is whether or not I can properly affect the City field if I'm doing this as an external module, or if I would need to add my code to the location module (location.inc).

I have a list with a 1 to 1 to 1 relationships of Province -> County -> City of all counties in USA as of 2010 that I will use. If anyone wants to help add to the project I can get it rolled out faster for everyone to use and I can provide my county list.

I'll be using functions similar to location_get_provinces like this: location_get_county($province) and location_get_city($county) to limit the autocomplete fields' options accordingly.

Any ideas, support, directions would be appreciated! I'll starting work on this immediately.

To summarize on the intended outcome: Instead of a plain textfield to enter the County in, it would be an autocomplete field that can be affected by what Province is chosen, and can affect what Cities can be chosen. Initially I would only do this for USA.

verres’s picture

has anyone made any progress with a location 'county' field for the current version of the module?

ctalley5’s picture

Subscribe - curious if this has made any progress.

trgreen17’s picture

Please, somebody, add a "county" field and make it work with Views! Here in the U.S., with any government work at all, we ALWAYS need the county. It's way more crucial than "location additional."

If I could do it myself I would.

And make it easy... it doesn't need to look up counties in states or limit city choices. Just give us a County field!

ctalley5’s picture

You're exactly right - so much here is based on County classification.

jsibley’s picture

Where do things stand with incorporating a county field. Could anyone please provide an update? Thanks.

jwjoshuawalker’s picture

Sorry, the $ behind that project decided not to make this happen when I presented the scope & time of getting the county field & other features in there.

I haven't had any other projects need this and therefore I haven't built it :(

At this point, I think time would be better spent getting Location going on D7. Maybe even getting counties or other configurations (extra fields) as on-site interface settings.

podarok’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

all feature requests should be rolled against latest 7.x-3.x-dev and after commit can be backported to 6.x branch

Status: Needs review » Needs work

The last submitted patch, 221370.patch, failed testing.

cydharttha’s picture

Issue summary: View changes

I built out a contrib for the county field, based off www field. I have it up at https://github.com/cydharttha/drupal_location_county right now; I'll work on getting it submitted to Location proper.

cydharttha’s picture

Here is a patch rolled against 7.x-3.x. Hope it helps!

cydharttha’s picture

Status: Needs work » Needs review
rudy.barrett’s picture

I've noticed that while the County can be selected and entered for a location in node>edit, it does not appear in the Full Display, Default (address) for the node template or in views in any way when the location field is set to display. I've checked the field and "County" is not set to hidden, but again it is not rendered anywhere on the node or in a view.

I actually found that one way to get the county to appear was to modify the location.tpl.php and add an "if county > print county" statement.