Closed (fixed)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
Address formats
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2012 at 07:00 UTC
Updated:
27 Jul 2015 at 04:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
er_d0s commentedComment #2
mstrelan commentedAlso, not sure if it's an Australian specific thing, but I would say "Address line 1" and "Address line 2" over "Address 1" and "Address 2".
Comment #3
aidanlis commentedYeha, we have a lot of customers typing their address twice, like they think it is a password verification. Can we have placeholder text as well? This is The Iconic's shipping form ... something like this would be nice: http://share.aidanlister.com/Lag9
Comment #4
aidanlis commentedIs there a reason this wasn't implemented as a base class with country specific overrides as methods? Seems like it would be much cleaner.
Comment #5
aidanlis commentedHere's a patch to display AU and NZ addresses properly. I haven't tackled the refactoring into a class.
Comment #6
mstrelan commentedI think this should also include a maxlength attribute for postal code. It's 4 in AU, not sure about NZ.
Also I don't think the placeholder HTML5 attribute is used in D7 modules as the default doctype is not HTML5. And "your address" is not appropriate anyway, as the addressfield is not necessarily for "you", it could be the address of anything.
And finally I would say Suburb/Town rather than Town / Suburb, at least for AU. Trying to find a form on the Australia Post website. Maybe https://digitalmailbox.auspost.com.au/registration.aspx which doesn't even mention Town.
Comment #7
aidanlis commentedAh good point about not having "Your" -- though placeholders work fine in HTML4. I guess we could make it optional, it does seem to provide a better form experience.
4 letters in both AU/NZ should be fine.
Suburb/Town makes sense as 90% of people will be suburban, but we need town for Bendigo, Mildura, etc.
Comment #8
rszrama commentedComment #9
aidanlis commentedRe-attaching a patch to work with the latest addressfield.
Comment #10
ergophobe commentedIt seems that the proper input form labels would be
Recipient name
Street address/PO Box number
Suburb/RD/lobby name/etc (= "dependent_locality" field?)
Town/City
Postcode
The proper output format would be
Kilbirnie PostShop
62 Bay Road
Kilbirnie
Wellington 6022
Note that the region is not part of a properly-formatted NZ address.
You can also use a "consolidated" format for output [1, page 81]
That would make the proper consolidated format
Kilbirnie PostShop
62 Bay Road
Kilbirnie Wellington 6022
The thing is, looking through museum websites and various places, few people seem to use the actual official format except the Contact page for NZ Post, they at least follow their own rules.
Still, it seems like Address Field should format according to official postal specs and if someone wants to put commas in here and there where they don't belong and omit this part and that, that would be up to theme to override it in their theme.
Sources.
These are definitive from NZ Post (and BTW, notice the suspiciously familiar file paths!):
1 - http://www.nzpost.co.nz/sites/default/files/uploads/shared/standards-gui...
2 - http://www.nzpost.co.nz/sites/default/files/uploads/shared/standards-gui...
3 - http://www.nzpost.co.nz/sites/default/files/uploads/shared/standards-gui...
4. http://www.nzpost.co.nz/sending-within-nz/how-to-address-mail/different-...
5. http://www.nzpost.co.nz/business/sending-within-nz/over-300-letters-docu...
Other Sources
6. http://bitboost.com/ref/international-address-formats/new-zealand/
7. http://en.wikipedia.org/wiki/Postcodes_in_New_Zealand
8. https://www.tinz.net.nz/addressing-standards.html
9. http://www.addressdoctor.com/en/countries-data/address-formats.html
Comment #11
ergophobe commentedA few helpful links on Australian formats
1. http://www.ipaustralia.gov.au/about-us/corporate/address-standards/
2. http://auspost.com.au/parcels-mail/addressing-guidelines.html
3. http://www.nrm.qld.gov.au/factsheets/pdf/land/l111.pdf
4. http://www.staff.uwa.edu.au/facilities/mail/formats
5. http://en.wikipedia.org/wiki/Suburbs_and_localities_(Australia)
6. http://en.wikipedia.org/wiki/Address_(geography)#Australia
According to #2
According to #3
It looks like it should be labelled like this on the input form
Recipient Name
Premise
Street/P.O. Box
Suburb/Locality
State/Territory
Postcode
And on output it should be
Joan Doe, curator
Australian Museum
6 College Street
SYDNEY NSW 2010
A couple of questions
1. So properly speaking Address Line 1 should be "premise" and Address Line 2 should be "thoroughfare," but will this break anything? It shouldn't, since those are just labels, but those who are already collecting data using the US format and entering Australian data will have these reversed.
2. Should the default theming automatically convert city and state to uppercase to conform with postal service standard, or leave that to the user to input (and thus output) as they wish?
Comment #12
ergophobe commentedBased on the above, I'll throw out another option...
#2 likely implies that there needs to be some sort of upgrade path, so there needs to be an install hook before this patch or one like it could be committed. I have no idea what people are doing now with NZ addresses, though, so I don't really know what the install hook should look like.
An alternative to using dependent_locality would be to use sub_administrative_area for the Town/City field for NZ and use locality for the Suburb/RD/PO Box/Private Bag field, but that seems incorrect. But then, I've spent a total of two weeks in NZ, so what do I know?
This still "needs work" but setting to "needs review" b/c it needs that too ;-)
Comment #13
rooby commentedI agree that it should be like this:
Although "Suburb/Locality" is usually "City/Town" on any most forms I've ever filled in.
Sometimes I've seen "Town/Suburb" but rarely or never "Locality".
And premise is often "Unit number" or similar.
The thing that I think is the most important here is the fact that address 1 & address 2 are backwards.
Address 1 on this module is street and address 2 is premise/unit/etc. but the way we fill out addresses here is the opposite of that.
That is the thing most likely to cause problems IMO. I feel like most users can handle the other label differences.
I'm actually quite surprised by (but then again I should know better than to assume things are obvious):
Another thing I see is:
I don't think we should do this. I think it is outside the scope of this module.
If drupal core had placeholder support I would say yes but it doesn't.
For that use a module like placeholder, field_placeholder, form_placeholder, etc.
Comment #14
ergophobe commentedThis should all be handled in Addressfield 2.0, though I'm not sure that will work in D7
https://drupalcommerce.org/blog/16864/commerce-2x-stories-addressing
Comment #15
rooby commentedCreating new versions and new features of things is all well and good but fixing bugs in existing code that people are trying to use should probably take priority I would think, at least to some extent.
I hope when 2.x is out it gets bug fixes.
Comment #16
ergophobe commentedRooby... rereading your comment, most of what you mention is addressed (so to speak) in my patch.
As for the label Suburb/Locality, that is as recommended by the Australian Post. Whether people follow that recommendation, I can't say.
Comment #17
bojanz commentedHello, everyone. This issue is now on top of my TODO list.
Looking at the #10 patch, I see it's removing regions for New Zealand, waiting for confirmation of that in #2387967: Remove New Zealand regions.
Comment #18
bojanz commentedNew Zealand no longer has regions, and now has a Suburb field by default:
http://cgit.drupalcode.org/addressfield/commit/?id=c3094ec
I'll reroll and commit the patch in the next few days.
Comment #19
ergophobe commentedbojanz - just so you know, everything I know about Australia and NZ addresses is in the links I posted above from the official postal services and was the best info I could find at the time.
I do believe that the documents I used are definitive, so I'm pretty sure it's *right* though maybe not *usual* practice (one of the things I've found from polling Australians is that they have a loose understanding of their addressing system and no two of them I talked to agree!).
I just took this on because I had a need - I'm an American who has traveled to Australia and NZ, but that's about it!
What I've got is definitely better than what is in place now though and I think it's right.
Comment #20
rooby commentedI would still argue that "Locality" is not something that is used in Australia in relation to the suburb field and when building websites I would probably go out of my way to change the label.
I can't speak for New Zealand but I have lived in Australia for 30 years and I have never seen it on a form or Australian website that I can remember and anyone I've spoken to says they either haven't seen it or have seen it extremely rarely and not recently.
I'm aware that this is only based on my memory and people I've spoken too but I'm happy to be corrected if you can find somewhere formal that states that it is part of the format.
The links in #11 are all either broken links or don't say anything about locality.
Personally I haven't been able to find a document that specifically says what the labels should be (I haven't spent all that much time searching) but anything I have seen says either "Town", "City", "Suburb", "Town/Suburb" or "City/Suburb".
It also seems that just "Town" or "City" alone aren't as prevalent as they used to be.
Comment #21
ergophobe commentedIt looks like half of the resources I cited just 10 months ago are 404.
I did find this on the AusPost site which does list the level above State/Territory as "Placename/suburb/locality"
http://auspost.com.au/media/documents/australia-post-addressing-standard...
I couldn't care less one way or the other. It's dead easy to change the labels and I'm happy to do so if someone has a solid single answer. Should it be "Town/Suburb"?
BTW, I'm not actually using this as a patch. I broke it out into a module for my use so that I didn't have to worry about patching Addressfield when it updates. Ideally, though, I'd kill that module once there's an integrated solution.
Comment #22
bojanz commentedI see that there's some uncertainty around the labels, so I consulted the web sites of Australian post and New Zealand post (screenshots attached).
Based on that, I did the following:
- Used "City/Suburb" as the locality label for Austria.
- Left "State" as the administrative area label for Australia, and "Suburb" as the dependent locality label for New Zealand..
If anyone doesn't like it, they can implement the newly added hook_addressfield_address_format_alter().
I'm open to changing the NZ dependent locality label to "Suburb/Rural delivery no." if there's agreement on that.
As for the address lines, I've removed the placeholders because they're inconsistent with the UX of the rest of the module.
I've changed the address 1 label and removed the address 2 label, and I'm open to removing the address 2 line completely.
However, I see in a screenshot above that some sites still keep the two lines.
What do you think?
Comment #23
rooby commentedThe Australia one looks really good to me.
I like the removal of the address 2 label but I think leaving the two lines is a good idea.
In my experience a lot of clients still want 2 fields and if you're customising it's probably easier to remove a line than add one in.
I also agree that placeholder text should be handled externally as that seems to be the way all Drupal fields work at this stage.
Comment #25
bojanz commentedThanks for the feedback, rooby.
I've committed the patch. Feel free to continue providing feedback, we can make followup commits.
Comment #26
joshtaylor commentedPerfect, Australian addresses look sane!
Comment #27
ergophobe commentedBojanz, that is brilliant. I looked and looked for official documents... never occurred to me to just try to buy something and see what they ask for on the postal service website.
One fewer patch to apply. Thanks Bojanz!
Comment #28
joshtaylor commentedWhen applying this fix, the address line 2 still shows.
EDIT:
Okay, it was meant to show, disregard.
Comment #30
capfive commentedHi Guys, sorry to weigh in on this, but the label is still incorrect.
City/Suburb is really confusing. If my address was Surry Hills, this is a suburb, in the city of Sydney, so even thought I live in the city of Sydney, my suburb is Surry Hills, so would it be Surry Hills to put in the field, Sydney? or Sydney/Surry Hills?
Traditionally in Australia, All you need is the Address, Suburb, Postcode and State, this is the correct format for any Australian address as outlined on Australia Post (our biggest postal network in the country)
as seen here http://auspost.com.au/education/letterwriting/students/addressing.html
If we could get this changed to the following:
Address
Suburb
State
Postcode
That would then be the correct format.
Also just as some backup proof, the Australian government also doesn't use City, also they refer to it as a "Suburb/Locality/City/County" they also state that "Generally suburbs/localities are fully spelled out" but we NEVER use the term Locality as a colloquial one, Suburb would be perfect - Source http://www.ipaustralia.gov.au/about-us/doing-business-with-us/address-st... (Australian Government Information Protection Website)
Comment #31
capfive commentedComment #32
rooby commented@capfive:
"City/Suburb" and "City" are possible not so common on government forms (something I have not confirmed for myself - I can recall government forms that include city) but they are very common on forms in general so I doubt that someone seeing "City/Suburb" would be unable to continue due to confusion unless they are unfamiliar with common usage of the slash punctuation mark in English.
The problem with "Suburb" alone is that a lot of people don't live in suburbs.
Larger cities have suburbs but small towns do not.
In that case "Suburb" really doesn't make sense and could be considered confusing.
Thinking about it that way "Town/Suburb" is probably a better option although "Town" and "City" have an extremely similar meaning in the context of an address form.
The "Addressing an envelope" page that you link to on the Australia Post website is to help the general public to not write addresses in a ridiculous fashion on their mailings, it is not a formal specification of mailing address format.
If you follow the breadcrumbs back from that page to http://auspost.com.au/education/letterwriting/index.html it is actually not even aimed at the general public but at children learning to correctly address a letter.
I would even go out on a limb and say I think I could write to them and get them to add town or city to that in addition to suburb so as to be more complete.
While the link you provide to the ipaustralia.gov.au website does indeed talk specifically about suburbs/localities it never states that city/county are not to be used.
The fact that it mentions Suburb/Localities/City/County all together indicates they are interchangeable in terms of that line of the address.
Since, as you mention, we practically never use locality, and I would add the same regarding county, that leaves city and suburb as the ones that we do regularly use.
I would vote against making it "Suburb" but would be happy with either "Town/Suburb" or "City/Suburb".
Comment #33
capfive commented@rooby good points made, I guess just knowing how to overwrite it then per country is for a different post :) I am happy with the points you made and i agree :) I actually think Town/Suburb, or maybe City or Suburb / Town or Suburb which indicates to the person filling out the form that it is an or option, not a and/or option might help?
Anyhow changing this back to Closed (fixed)
I like being proven wrong as long as the reason is right :P