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.
We'll need an address field. Target functionality:
- Allows multiple items, each of a different type, e.g., home, work, cel/mobile
- Allows extensions.
- Formats phone numbers on display, e.g., adding parentheses and dashes as appropriate.
- Allows area codes and supports multiple countries.
- TBD: do we need validation? This is complex, given the many different formats in different regions and countries.
- Ditto for input masks, e.g., (XXX) XXX-XXXX. Useful but hard to get right for all variations.
Options:
- Custom text or integer field.
- Phone number.
- Phone.
- Address Field Phone.
- Telephone (backport of Drupal 8 core telephone module)--no stable release.
See also phone module comparison page.
Address Field Phone is simple and integrates with Addressfield, which we're already using, so it's likely our best bet.
Comments
Comment #1
nedjoDid some quick evaluation of both Phone (phone) and Phone number (cck_phone).
Unfortunately neither provides a close fit for our needs here.
Phone:
Phone number (cck_phone):
Comment #2
nedjoThere are various sandbox projects including:
Comment #3
nedjoRedHen developers are planning to add a custom solution, see #1748636: Recommended solution for phone number field?.
Postponing until there is a better solution to build off of. Meantime, we can add documentation suggesting users add phone numbers to a generic text field, see #1774452: Add additional information text field to contact types and organization types.
Comment #3.0
nedjoExpand target functionality list.
Comment #4
nedjoComment #5
nedjoComment #6
nedjoWe could go with Address Field Phone. Telephone might also be a candidate, except that it lacks a stable release.