I have a page view for image gallery. It has only 1 Photo field of Photo which has a field of type Image. In view it use "Lightbox2: lightshow: small-square -> large" as formatter. small-square is a custom image style.
The rendered page doesn't show any alt tag:
<img typeof="foaf:Image" src="http://www.example.com/sites/default/files/styles/small-square/public/6486388587_61846b6d84_1323732945.jpg" width="240" height="240">
I need to add alt tag to images. What do I have to change?
My drupal installation has these versions:
- Drupal 7.10
- Lightbox2 7.x-1.0-beta1
- Views 7.x-3.0-rc3
looking at Lightbox2 modules's file lightbox2.formatter.inc it seems that alt tab should be forced to show, using image title.
// Set up the title.
$image_title = $item_data['description'];
$image_title = (!empty($image_title) ? $image_title : $item_data['title']);
$image_title = (!empty($image_title) ? $image_title : $item_data['alt']);
if (empty($image_title) || variable_get('lightbox2_imagefield_use_node_title', FALSE)) {
$node = node_load($node->nid);
$image_title = $node->title;
}
$image_tag_title = '';
if (!empty($item_data['title'])) {
$image_tag_title = $item_data['title'];
}
// Enforce image alt.
if (!empty($item_data['alt'])) {
$image_tag_alt = $item_data['alt'];
}
elseif (!empty($image_title)) {
$image_tag_alt = $image_title;
} $image_tag_alt = '';
if (!empty($item_data['alt'])) {
$image_tag_alt = $item_data['alt'];
}
elseif (!empty($image_title)) {
$image_tag_alt = $image_title;
}
So... where is the error?
$item['alt']
value in functiontheme_lightbox2_image($variables)
inlightbox2/lightbox2.formatter.inc