I wanted to put my imagefield field above the title on my pages. I couldn't find any good documentation. Finally, I came up with:

<?php if ($node->field_your_name[0]): ?>
     <?php print theme(
          'imagefield_image',
          $node->field_your_name[0],
          $node->field_your_name[0]["alt"],
          $node->field_your_name[0]["title"]);
     ?>
<?php endif; ?>

It seems to work. If you know a better way, please comment.

Imagecache + thickbox

<?php if ($node->field_your_name[0]): ?>
<?php print theme(
        'imagefield_image_imagecache_thickbox', 
        'min',  // name of preset
        $field_your_name[0],
        $field_your_name[0]['filepath'],
        $field_your_name[0]['alt'],
        $field_your_name[0]['title']
        );
?>
<?php endif; ?>

Comments

Fleshgrinder’s picture

It's also possible to do the following (Drupal 6):

if ($node->field_your_name[0]) print $node->field_your_name[0]['view'];
Fayna’s picture

Thank you for this snippet! Worked like a charm. Only problem was the imagefield kept showing up twice, once above the title and the other within the content. With CSS I hid it. Is there another way to only have it display once?

enkara’s picture

Hide it in "display fields" in the content type