Address display formatting
scedwar - March 18, 2008 - 20:01
| Project: | Address field for CCK |
| Version: | 5.x-2.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Using the simple display controls for cck output (not themeing, these content types are too simple to bother), the address is output like this:
Address:
10 Downing Street
LondonW1 123 UKThis is just ugly. Can the default be set to make sure there is at least a space, and preferably a carriage return to make the address it look like this:
Address:
10 Downing Street
London W1 123
UKor
Address:
10 Downing Street
London
W1 123
UKThanks, Stephen

#1
What field is W1? I'm not sure why there isn't a space between London and W1. Is that part of your postal code? It seems to me there should be a space there in the standard theme. As for the other ideas, that's great for the UK, but not for the USA. What I am thinking of is extending the theme functions so that the sub-modules could define their own. That way India, Spain, UK, etc. could each have their own themes and do as you suggest. Until that happens, you'll have to just override, or edit the original.
#2
The "W1 123" is stored in the zip code (postal code in the UK). Either of the second or third forms of address would be acceptable in the UK. The main thing is that 'country' should be separate on the last line and I can't think of a country I've come across where that isn't the convention. Postal codes, however, are a whole other matter!
#3
#4
Addresses can be formatted using theme_cck_address()