Attached are themed templates (location-xx.tpl.php) aimed at correct display of the address part of locations. They follow the standards set by the International Postal Union (UPU) for the way addresses should be diplayed. See http://www.upu.int/post_code/en/postal_addressing_systems_member_countri... for references. I have worked my way through all countries of the European Union, all G20 member countries (I think) and a few additional east European countries.

Interpreting locations as addresses means that those parts of the locations that are left out normally are not included for output. For example, most central European countries do not use province/state codes or names in addresses, or Ireland does not use postal codes at all. I think that is a common sense approach that should be fit for most applications.

In addition, it should be noted that I have included a default template that is formatted slightly different from the current one: instead of <div class="..."> tags to separate the vCard elements, I generally use <span class="..."> and <br/> for line breaks. This makes more sense since the whole point of these templates is to provide an output order for the elements. div elements are not arranged in any predefined way, especially not in lines one below the other. The UPU rules are especially about lines, and so br should be better suited.

CommentFileSizeAuthor
location-xx.tar_.gz3.02 KBccprog

Comments

Patrick Nelson’s picture

Thank you for this work Claus - really useful - and came at just the right time. Brilliant!

ankur’s picture

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

Makes sense. Changing version to 7.x-4.x since that's where new features are now going.