This module provides a HTML5 phone field that supports
the tel:
schema that is available on most
recent smart-phones.
The HTML5 tel:
schema is defined in 2004, in
RFC3966: The tel
URI for Telephone Numbers. For an update, see
Geoff
Graham: The Current State of Telephone Links .
After the module has been enabled, a Phone number field becomes available and may be added to an entity bundle. When you do, a form for setting up the field (like the one shown below) appears.
A phone link label (e.g. “Call us”) for can be set to static, optional, or no label. If the label is optional, there will be a translatable field for the label along with phone number field on each entity instance. If the label is static, the phone link will always use the same label. The static or default label is entered on the form for editing the phone field settings for a particular entity. A static or default label cannot be translated.
The module provides four format options that can be selected in the column “Format” under the “Manage display” tab.
If hook_phonefield__supports_tel()
is implemented, and
it returns FALSE, a link will not be created, even if a
format option to create a link is choosen.
If the label is optional, and there is no default link label, the phobne number will be used as anchor text. When the number is used as anchor text, the formatted version is shown, while the normalized version of the number is used for phone links.
If you add a phone number field to the user entity, you may want to prevent it from being dislayed as part of the user's public user profile, by setting its display property to “Hidden”.
The phone field created by this module is a free format text field. There is no provision for custom formatters or country codes. The module is intentionally lightweight on features. There is no validation of the number entered.
While this may be perceived as a limitation by some, this also means that you can enter a number that is human viewable confirming to any local convention for displaying phone numbers, including hyphens and brackets.
tel:
-link does not work.tel:
-produces no result, or produces an
error message from the browser (e.g. “The address wasn’t understood”
or “The webpage cannot be displayed”).hook_phonefield__supports_tel()
. See the
next help page for a description of this hook.No questions yet.