Displaying Images in Search Results I have a Resource content type that has an image field (field type and widget are both 'image'); the standard image type.  The title of this field is 'Icon' and the machine name is 'field_icon'. I created my teaser so that the title, date, image, and description fields show and customized my search-result.tpl.php and template.php files so they are displaying the teaser/snippet. That works fine.

However, now I'd like to be able to format the returned results a bit more. I see how I can put HTML directly in the .tpl file, fine. But I want to customize the image field so it appears to the LEFT (float or align left) of the other returned teaser elements.

My problem is I can't figure out how to get the variable that represents the image so I can manipulate it in my .tpl file. I tried the following, but it just returns the number to indicate there IS an image or not:

$result['node']-&gt;'field-icon';


Can someone please tell me how to get the proper variable or link to the icon itself so I can manipulate it in my .tpl file?

Thank you.

Note, here's my current search-result.tpl.php code:

&lt;li class="&lt;?php print $classes; ?&gt;"&lt;?php print $attributes; ?&gt;&gt;
  &lt;?php print render($title_suffix); ?&gt;
  &lt;div class="search-snippet-info"&gt;
    &lt;?php if ($snippet): ?&gt;
      &lt;?php print $snippet; ?&gt;
    &lt;?php endif; ?&gt;
  &lt;/div&gt;
&lt;/li&gt;
Perhaps something like this will help:

/**
 * Implements hook_preprocess_search_result()
 */
function MYTHEME_preprocess_search_result(&amp;$variables) {    
    $node = $variables['result']['node'];
    if (is_object($node) &amp;&amp; $node-&gt;nid) { // if the result is a node we can load the teaser
        $variables['teaser'] = node_view($node, 'teaser');
    }
}


That will provide the variable $teaser to your search template. In search-result.tpl.php you can then access your field data:

&lt;div class="search-snippet-info"&gt;
    &lt;?php print render($teaser['field_icon']); ?&gt;
    &lt;h2&gt;&lt;a href="&lt;?php print $url; ?&gt;"&gt;&lt;?php print $title; ?&gt;&lt;/a&gt;&lt;/h2&gt;
    &lt;?php if ($snippet): ?&gt;
      &lt;?php print $snippet; ?&gt;
    &lt;?php endif; ?&gt;
&lt;/div&gt;