You are here

function url_field_formatter_settings_form in URL field 8

Same name and namespace in other branches
  1. 7 url.module \url_field_formatter_settings_form()

Implements hook_field_formatter_settings_form().

File

./url.module, line 227
Provides a URL field type that stores external links with optional titles.

Code

function url_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $element['trim_length'] = array(
    '#type' => 'number',
    '#title' => t('Trim the link text to certain number of characters'),
    '#description' => t('To leave long link text alone, leave blank.'),
    '#default_value' => $settings['trim_length'],
    '#min' => 1,
  );
  $element['nofollow'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add rel="nofollow" to all links'),
    '#default_value' => $settings['nofollow'],
  );
  return $element;
}