Hi,

I'm building a site in Vietnam and it got a different set of fields that are supported out of the box from this module. In the release notes of the Beta version it says: "Our address formats are now completely extensible thanks to a revamped plugin system based on CTools"

I'm a developer but even with this background it takes a lot of effort to read through the code and understand how ctools works to extend it in a good way. I've seen that other have sent in pathes that changes the .inc file to suit their needs. Is this the way to go forward? It seams like that file can grow out of proportions if every country have it's own "else if"-statement in there. Would it be possible to get a starting point at least how to extend this module in a proper way?

Thanks for suppport,
Mattias

CommentFileSizeAuthor
#9 address.inc_.patch2.95 KBjkthng

Comments

damien tournoud’s picture

I've seen that other have sent in patches that changes the .inc file to suit their needs. Is this the way to go forward?

So, there are two issues here:

  • The way to write an addressfield format handler was not really documented. I committed an example module to the repository. It is available right now from Git and will be available in the next -dev in a couple of hours.
  • The address format for Vietnam doesn't seem to suit your needs. I would like to hear more about it. Which fields are missing, what do you want to add? We are trying to make sure that most of the countries of the world have a good starting point, so I would love to have more details about the issues you are facing.
damien tournoud’s picture

Status: Active » Fixed

I'm going to close this. You can refer to the example module in the source code to write a proper plugin.

Status: Fixed » Closed (fixed)

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

chaloalvarezj’s picture

Actually some documentation or explanation would be great since is not even possible to install the example module... or it is not supposed to be installed?.. Where should at place my "customized" module?

chaloalvarezj’s picture

Status: Closed (fixed) » Active

I'll re-open the issue so that anybody who knows how to do this can explain... please.

chaloalvarezj’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
dgastudio’s picture

/sites/all/modules/addressfield/example
addressfield_example.info
- hidden = TRUE

jkthng’s picture

Hi,

The typical address fields required for Vietnam are:

  1. Address 1
  2. Address 2
  3. City
  4. Country

A typical address looks like this:
117 Nguyen Duc Canh Street, My Duc, Tan Phong Ward, District 7, Ho Chi Minh City

Usually the Ward and District values are written in the same field as the Street value.

Is it possible to include a patch so that the default Vietnamese addressfield is correct & usable?

Thanks.

jkthng’s picture

StatusFileSize
new2.95 KB

Patch for Vietnam addresses.

jcmiller09’s picture

I changed the addressfield_example.info file to hidden=FALSE, and it showed up fine in the modules list, and added the formatter to the Display Suite settings. This is fine and well, but for the ease of upgrading the code of the module in the future, I would expect to be able to toss this somewhere outside of the module folder. How do we get this to exist on it's own outside of the addressfield module folder? Messing around with the code, I got it to show up as a custom module, but the functionality of the formatter broke.

Maybe a simple Readme file with some best practice suggestions?

mcm.guaba’s picture

+1
yes please!

Rick G’s picture

+1 on a Read.me to do this in a custom module outside the addressfield module folder

j0rd’s picture

Title: How to extend Address field » Extending Address field for Vietnam States

updating title for super ticket related to country customization.

jcisio’s picture

Status: Active » Closed (works as designed)

I'm closing this issue because:
- Viet Nam does have postal code http://en.wikipedia.org/wiki/Postal_codes_in_Vietnam. The fact that postal code is not commonly used inside the country does not change any thing at all, the postal code part is not required.
- The postal code is put at the end (after city and state/province) is correct.

So I don't see any problem with the current settings. About extension, there is an example already.