By radu_d on
Hi,
I have added using CCK a image field to Page type. My image field name is field_image. My problem is that in the page body I want to display images in a custom div. I used the php input filter for that. The code that i used is for getting first image is:
if ( arg(0) == 'node' && is_numeric(arg(1)) && ! arg(2) )
{
$node = node_load(arg(1));
$lightbox_path = imagecache_create_url('fullsize', $node->field_image[0]['filepath'] );
$imagecache_image = theme('imagecache', 'thumbnail', $node->field_image[0]['filepath']);
$imagetitle = $node->field_image[0]['title'];
print '<a rel="lightbox[my_gallery]" alt=" " title="' . $imagetitle . '" href="'.$lightbox_path.'">'. $imagecache_image .'</a>';
}
My problem is that image title is always empty. Also 'alt' field is empty. The thing is that if I display the field in list and use lightbox, the image have title and alt text. Did anybody had this issue?
Thanks a lot,
Radu