Writing a field formatter for D6 So I'm almost embarrassed to ask this, but it's been so long since I've touched Drupal 6. We've been asked for something which requires another Field Formatter for a File field. 

Form the code below, I'm able to select File download formatter in Content Type Display. However, when looking at the rendered page, I see no output for this field. 

During drush cc all I see the reponse "TEST ONE" print in the console denoteing that MODULE_theme() is running. But there is not a connection to  theme_MODULE_viewer. 

Once I get this wired up, I'm sure I can finish this in a hour, but what am I missing?

&lt;?php
**
* Implementation of hook_field_formatter_info().
*/
function MODULE_field_formatter_info() {
  return array(
    'socf' =&gt; array(
      'label' =&gt; t('File download formatter'),
      'field types' =&gt; array('filefield'),
      'description' =&gt; t('TO DO: add description'),
    ),
  );
}

/**
* Implements hook_theme().
*/
function MODULE_theme() {

  print "TEST ONE";

  return array(
    'MODULE_viewer' =&gt; array(
      'arguments' =&gt; array('element' =&gt; NULL),
    ),
  );
}

function theme_MODULE_viewer($element) {

  print "TEST TWO";
  return 'Future response here. ';
}


From my understanding hook_theme creates an awareness of theme_MODULE_viewer in the array key MODULE-viewer. 

In the Devel Tab, I see that the field contains data in both Load and Render panels.
Well I did this in a slightly different way. By using hook_preprocess_content_field(), I search through all of the fields in a node and do a str_replace() on those items. This does solve my problem but I'm open to a more elegant solution. 

function MODULE_preprocess_content_field(&amp;$variables) {

  for ($i=0; $i &lt; count($variables['items']); $i++) {
    $searchfor = variable_get('file_directory_path') . '/special_folder';
    $replacewh = 'portfolio/asset';
    $variables['items'][$i]['filepath'] = str_replace($searchfor, $replacewh, $variables['items'][$i]['filepath']);
    $variables['items'][$i]['view'] = str_replace($searchfor, $replacewh, $variables['items'][$i]['view']);
  }
}


Side note: The path portfolio/asset is part of this same module and defined in hook_menu. I would have preferred to have this done with a field formatter in the above code, but I've got to move on.