' . t('About') . ''; $output .= '

' . t('The Telephone module allows you to create fields that contain telephone numbers. See the Field module help and the Field UI help pages for general information on fields and how to create and manage them. For more information, see the online documentation for the Telephone module.', [':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString(), ':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#', ':telephone_documentation' => 'https://www.drupal.org/documentation/modules/telephone']) . '

'; $output .= '

' . t('Uses') . '

'; $output .= '
'; $output .= '
' . t('Managing and displaying telephone fields') . '
'; $output .= '
' . t('The settings and the display of the telephone field can be configured separately. See the Field UI help for more information on how to manage fields and their display.', [':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#']) . '
'; $output .= '
' . t('Displaying telephone numbers as links') . '
'; $output .= '
' . t('Telephone numbers can be displayed as links with the scheme name tel: by choosing the Telephone display format on the Manage display page. Any spaces will be stripped out of the link text. This semantic markup improves the user experience on mobile and assistive technology devices.') . '
'; $output .= '
'; return $output; } } /** * Implements hook_field_formatter_info_alter(). */ function telephone_field_formatter_info_alter(&$info) { $info['string']['field_types'][] = 'telephone'; } /** * Implements hook_field_type_category_info_alter(). */ function telephone_field_type_category_info_alter(&$definitions) { // The `telephone` field type belongs in the `general` category, so the // libraries need to be attached using an alter hook. $definitions[FieldTypeCategoryManagerInterface::FALLBACK_CATEGORY]['libraries'][] = 'telephone/drupal.telephone-icon'; }