Theming Imagefield Fields
Last modified: May 17, 2009 - 02:22
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; ?>