Addresses Fields

The Addresses field is similar to a Matrix field, but it manages nested address elements instead of entries. When you create an address it is “owned” by the element that field is attached to. Address fields are not relational fields.

Address fields are separate from users’ address book, and can be added to any element type!

my-project.ddev.site/admin/entries/vendors/123
Screenshot of addresses field with two nested address elements

# Settings

Address fields can be displayed to editors as cards or in a full element index. Either way, individual addresses are always displayed as cards.

You can also choose a minimum and maximum number of addresses that can be added to the field for the owner element to validate.

# Development

Like Matrix and relational fields, address field data is provided as an element query or element collection.

Typically, you will access addresses attached to an element via the field’s handle followed by a query execution method like .all():

{% set addresses = entry.contacts.all() %}

<h2>Contacts</h2>

<ul>
  {% for address in addresses %}
    <li>{{ address|address }}</li>
  {% endfor %}
</ul>
Addresses
Learn more about managing and displaying address data.