Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Overview
The addressfield_tokens module extends the addressfield module by adding full token support. It also adds some convenient addressfield formatters and provides a webform addressfield integration.
Features
Tokens
- Attaches tokens to every addressfield type within every entity.
- Creates a token for every addressfield component, including name, organization, thoroughfare, premise, locality, postal_code, and country.
- Allows token names to be configured for your locale (e.g. "thoroughfare" could be displayed as "Street 1" in the token table).
- Creates additional tokens:
- [addressfield:city-state]:
- City, State
- [addressfield:full]:
- Full address with formatting.
- [addressfield:text]:
- Full address without formatting, all on one line.
- [addressfield:country-name]:
- The full name of the country.
- [addressfield:state-name]:
- The full name of the state (applicable for countries where states have abbreviations selectable from a select list).
- [addressfield:mc-address]:
- A full address with each component separated by double-spaces, compatible with the MailChimp API.
Here's an example of the all the provided tokens, with locale customizations for the U.S.
Field Renderers
- City, State:
- The city and state separated by commas, with the country appended if not the default country.
- One line:
- The full address without formatting, suitable for display in CSV export views.
- Country:
- displays only the country.
- State:
- displays only the fullname of the state or administrative area.
- Components:
- select which components of the address should be displayed, and the separator that should be used between them. The components include both the abbreviated and full versions of the state and country.
Web Forms
- Integrates with webforms to create address fields.
Theme functions
- theme_addressfield_formatter:
- Renders an address using the default generator associated with the given handler (the ctools plugin name).
- theme_addressfield_formatter__citystate:
- Renders only the city, state and country separated by commas
- theme_addressfield_formatter__linear:
- Renders each of the addressfield components as single line, separated by commas.
- theme_addressfield_formatter__components:
- Renders any of the address components, separated by a given separator.
Each theme function can also be overridden per country. For instance, theme_addressfield_formatter__citystate__us
Dependencies
Integrates with
Credits
This module is provided by New Signature.
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Site Structure, Developer Tools
- 4,114 sites report using this module
- Created by amarcus on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
7.x-1.14
released 16 December 2019
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.