$49

Smart Map

Documentation  •  Changelog

Documentation

Automatically format an entire address

It's now easier than ever to output a pre-formatted address field!

You can keep the entire address on a single line by calling the field directly as a string...

{{ entry.myAddressField }}

123 Main St, Suite #101, Springfield, CO 81073

Alternately, you can use the "format" method to split the address up into two or three lines...

{{ entry.myAddressField.format }}

123 Main St<br>
Suite #101<br>
Springfield, CO 81073

Optional line breaks

There may be occasions where you don't want the address to occupy three full lines. The "format" method provides two optional parameters:

  • Keep apartment or suite info on same line? (Defaults to false)
  • Keep city & state info on same line? (Defaults to false)

So to keep your unit information on the first line, simply add a "true" parameter...

{{ entry.myAddressField.format(true) }}

{# Puts the unit number on the first line #}

123 Main St, Suite #101<br>
Springfield, CO 81073

Or you can even flatten it all to a single line by adding another "true" parameter...

{{ entry.myAddressField.format(true, true) }}

{# Displays the entire address on a single line #}

123 Main St, Suite #101, Springfield, CO 81073