Programmatically render an imagefield in Drupal 6 as defined in content-field.tpl.php What sounds like simple task in the first place, has taken me hours without getting a solution: All I want is to render single values of an imagefield just as in the normal node, i.e. as defined in content-field.tpl.php. This is important for me, because there I add captions from the Imagefield Extended module

I tried with content_format(), but with the "default" formatter it gives me just an icon and a link and with the "image_imagelink" formatter from the imagefield.module I get an image, but not as defined in content-field.tpl.php and in the node type's display settings:

print content_format('field_image', $vars['node']-&gt;field_image[1], 'default', $vars['node']);
print content_format('field_image', $vars['node']-&gt;field_image[1], 'image_imagelink', $vars['node'])


I have tried a couple of other things and searched for hours, but I cannot find an answer. Any ideas how I can render the image "just the normal way"?

The HTML out I want is a defined in the template something like this:

&lt;div class="field field-type-filefield field-field-image"&gt;
  &lt;div class="field-items"&gt;
    &lt;div class="field-item odd"&gt;
      &lt;a class="imagefield imagefield-lightbox2 imagefield-lightbox2-page-grid-6 imagefield-field_image imagecache imagecache-field_image imagecache-page-grid-6 imagecache-field_image-page-grid-6 lightbox-processed" rel="lightbox[field_image][Caption text]" href="http://example.com/files/imagecache/image_full/img/2014/img.jpg"&gt;
        &lt;img width="364" height="242" title="Caption text" alt="Caption text" src="http://example.com/files/imagecache/page-grid-6/img/2014/img.jpg"&gt;
      &lt;/a&gt;
      &lt;div class="img-meta"&gt;
        &lt;div class="img-title"&gt;
          &lt;p&gt;Caption Text&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class="img-source-info"&gt;
          &lt;div class="img-source"&gt;
            &lt;span class="img-source-label label"&gt;Source:&lt;/span&gt; 
            &lt;span class="img-source-content content"&gt;Source text&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="img-license"&gt;
            &lt;span class="img-license-label label"&gt;Licence:&lt;/span&gt; 
            &lt;span class="img-license-content content"&gt;Licence text&lt;/span&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
Do you have more than one image?

print content_format('field_image', $vars['node']-&gt;field_image[0], 'default', $vars['node']);
print content_format('field_image', $vars['node']-&gt;field_image[0], 'image_imagelink', $vars['node']);


Try again with [0] instead of [1]. I use those all the time and it works fine like that.