Enable field formatter settings I have a field that I created using hook_field_extra_fields, and I want it to have a cogwheel like in the image below, so that I can customize it. Right now the only format setting for the field is "Visible". Any ideas on how to enable the formatter settings for that field?

Note that I am also using display suite.
You can use hook_field_formatter_settings_form to add formatting of the field as shown in example below:

function example_field_formatter_info() {
  $info = array();
  $info['default_formatter'] = array(
    'label' =&gt; t('Show as link'),
    'field types' =&gt; array('example_field_type'),
     'settings' =&gt; array('target' =&gt; '_blank'), // &lt;--- THIS
  );
  return $info;
}

function example_field_formatter_settings_form($field, $instance, $view_mode, $form, &amp;$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $element = array(); 
  if ($display['type'] == 'default_formatter') {
    $element['target'] = array(
      '#type' =&gt; 'select',
      '#title' =&gt; t('HREF target'),
      '#options' =&gt; array('_blank' =&gt; 'New window', '_self' =&gt; 'Same window'),
      '#default_value' =&gt; $settings['target'],
      '#description' =&gt; t('Control where the link opens (i.e. set the TARGET attribute of the A element).'),
    );
  }
  return $element;
}

function example_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $settings = $display['settings']; // Key needs to be defined in info array (who knew?)
  $element = array();
  if ($display['type'] == 'default_formatter') {
    $target = $settings['target'];
    foreach ($items as $delta =&gt; $item) {
      $element[$delta]['#markup'] = "&lt;a href=\"{$item['href']}\" target=\"{$target}\"&gt;{$item['label']}&lt;/div&gt;";
    }
  }
  return $element;
}


Update #1:

/**
 * Implements hook_field_formatter_settings_summary().
 */
function example_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = t('Show as link'); // we use t() for translation and placeholders to guard against attacks
  return $summary;
}