Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#19 | location-county_field-221370-19-d7.patch | 6.34 KB | cydharttha |
| |||
#6 | 221370.patch | 780 bytes | skyredwang |
location_county.zip | 3.45 KB | Jody Lynn |
Comments
Comment #1
smitty CreditAttribution: smitty commentedDid you see this: http://drupal.org/node/165834 ?
Comment #2
Jody LynnNo 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.
Comment #3
smitty CreditAttribution: smitty commentedThanks 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.
Comment #4
Jody LynnHi 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.
Comment #5
smitty CreditAttribution: smitty commentedI 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.)"
Comment #6
skyredwanghere is my patch
Comment #7
YesCT CreditAttribution: YesCT commentedThis 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.
Comment #8
mbinz CreditAttribution: mbinz commentedHave there been any updates or alternatives regarding this issue?
Comment #9
jwjoshuawalker CreditAttribution: jwjoshuawalker commentedA 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.
Comment #10
verres CreditAttribution: verres commentedhas anyone made any progress with a location 'county' field for the current version of the module?
Comment #11
ctalley5 CreditAttribution: ctalley5 commentedSubscribe - curious if this has made any progress.
Comment #12
trgreen17 CreditAttribution: trgreen17 commentedPlease, 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!
Comment #13
ctalley5 CreditAttribution: ctalley5 commentedYou're exactly right - so much here is based on County classification.
Comment #14
jsibley CreditAttribution: jsibley commentedWhere do things stand with incorporating a county field. Could anyone please provide an update? Thanks.
Comment #15
jwjoshuawalker CreditAttribution: jwjoshuawalker commentedSorry, 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.
Comment #16
podarokall feature requests should be rolled against latest 7.x-3.x-dev and after commit can be backported to 6.x branch
Comment #18
cydharttha CreditAttribution: cydharttha commentedI 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.
Comment #19
cydharttha CreditAttribution: cydharttha commentedHere is a patch rolled against 7.x-3.x. Hope it helps!
Comment #20
cydharttha CreditAttribution: cydharttha commentedComment #21
rudy.barrett CreditAttribution: rudy.barrett commentedI'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.