Add formatted address tokens

Created on 21 November 2022, over 1 year ago
Updated 29 June 2023, about 1 year ago

Problem/Motivation

Addresses have a lot of variations in formatting. So using individual tokens to generate an address will not work 100% of the time. Even if you only do formatting for a single country the formatting will not work 100% of the time. e.g in Australia an address has an optional second address field, so the field will be formatted incorrectly when the second field is not set. When the second like should be removed when it is not set.

Steps to reproduce

This is an example of using token to display an Australian address.

[term:address:address_line1]
[term:address:address_line2]
[term:address:locality] [term:address:administrative_area] [term:address:postal_code]

This will not correctly display an address for other countries and also this is will not display correctly. eg

123 Flinders St

Melbourne VIC 3000

So the second line should be remove is display like

123 Flinders St
Melbourne VIC 3000

Also the other situation you may a single line address.

Proposed resolution

I would like to see a formatted token which a couple of subtypes.

[term:address:formatted] - returns a multi like html formatted address.
[term:address:formatted:text] - returns multi line address in text. i.e. CR instead of
[term:address:formatted:single] - returns a single like address.

✨ Feature request
Status

RTBC

Version

1.0

Component

Code

Created by

🇦🇺Australia gordon Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024