Twig template variables: Addresses
The address variables show the parts of an address (for example, the street lines and the country). Use the address variables after a variable that shows an address (for example, contact.PostalAddress).
You can use the address variables after:
contact.PostalAddresscontact.PhysicalAddressdepartment.PhysicalAddress- Each address in
contact.Addresses
The variable before the address variable selects the address. For example, Street1 shows the first street line of the postal address or of the physical address.
Example:
Postal address: {{ contact.PostalAddress.Street1 }}
Physical address: {{ contact.PhysicalAddress.Street1 }}In this example:
contact.PostalAddress.Street1shows the first street line of the postal address of the contact record.contact.PhysicalAddress.Street1shows the first street line of the physical address of the contact record.
| Record | The document shows |
|---|---|
| Mr Lister, Dave. The postal address and the physical address are different. | Postal address: 3000 Internet Blvd Ste 200 Physical address: 19 Hopetoun Street |
Variables that show formatted content
Some of these variables show content with formatting (for example, a table or an address with a line break after each line). Variables of this type show the content in HTML. To show the formatting in the document, use the raw Twig filter. The Function column of each variable of this type has a note about the raw filter.
After the variable name, enter a vertical bar and raw.
raw filter, the document shows the HTML tags as text.Example:
{{ contact.PostalAddress.AddressHtml|raw }}In this example:
contact.PostalAddress.AddressHtmlshows the full address, with a line break after each line.- The
rawfilter shows each line of the address on a new line.
Variables
| Name | Classic template system equivalent? | Function |
|---|---|---|
{{ contact.PostalAddress.Street1 }} | No | Shows the first street line of the address. |
{{ contact.PostalAddress.Street2 }} | No | Shows the second street line of the address. |
{{ contact.PostalAddress.CountryName }} | No | Shows the name of the country of the address. |
{{ contact.PostalAddress.AddressHtml }} | No | Shows the full address, with a line break after each line. |
{{ contact.PostalAddress.Name }} | No | Shows the name of the address. |
{{ contact.PostalAddress.Contact }} | No | Shows the contact record that is related to the address. Tip: To show more information about the record, add one more variable after this variable, for example {{ contact.PostalAddress.Contact.Name }}. |