Using Custom Formatters module to output an image's URI I'm trying to make a formatter which prints an image's URI instead of the image itself. My problem is I don't know what the formatter is expected to return. The help information is apparently not working on my install.

So, what does it expect as it's return value? This is what I've tried:

function image_path_formatter($vars) {
    $element['content'] = $vars['#items'][0]['uri'];
    return $element;
}


My view has this in content:

&lt;div&gt;&lt;div class="contextual-links-region"&gt;
&lt;div class="contextual-links-wrapper"&gt;
&lt;ul class="contextual-links"&gt;
&lt;li class="custom-formatters-edit first last"&gt;
&lt;a href="/?q=admin/structure/formatters/list/image_path/edit&amp;amp;destination=look-book"&gt;Edit formatter&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
You should take a look at the file module, which does a lot of this already

For Drupal 7:

/**
 * Implements hook_field_formatter_info().
 */
function file_field_formatter_info() {
  return array(
    'file_default' =&gt; array(
      'label' =&gt; t('Generic file'),
      'field types' =&gt; array('file'),
    ),
    ...
  );
}


/**
 * Implements hook_field_formatter_view().
 */
function file_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();

  switch ($display['type']) {
    case 'file_default':
      foreach ($items as $delta =&gt; $item) {
        $element[$delta] = array(
          '#theme' =&gt; 'file_link',
          '#file' =&gt; (object) $item,
        );
      }
      break;
    ...
  }
  return $element;
}


You could copy this and create your own theme function, all it needs to do, would be to print the uri and you're done.