Following the web accessibility guidelines all images/photos need to have a descriptive alt text. I'm using the alt text in imagefield but it is not used in the code that builds the gallery. For the thumbnails the alt text is empty, for the main image there is no alt text.

CommentFileSizeAuthor
#1 ad_gallery.1042680.patch733 bytesmaikeru

Comments

maikeru’s picture

Status: Active » Needs review
StatusFileSize
new733 bytes

The theme function in ad_gallery.theme.inc uses 'description' rather then 'alt'.

Attached is a patch against 6.x-1.x-dev, but should work against 6.x-1.9.

hansrossel’s picture

Status: Needs review » Reviewed & tested by the community

Works perfectly (also for 6.x-1.9) ! Thanks!

hansrossel’s picture

The main disadvantage of the patch of #1 is that the alt text and title text of the image are both appearing in the description field.

This is caused by the ad gallery js script itself, in jquery.ad-gallery.js line 315:

Replace

var desc = false;
  if(thumb.data('ad-desc')) {
  desc = thumb.data('ad-desc');
  } else if(thumb.attr('alt') && thumb.attr('alt').length) {
  desc = thumb.attr('alt');
  };

with

var desc = false;
    if(thumb.data('ad-desc')) {
    desc = thumb.data('ad-desc');
   } else if(thumb.attr('alt') && thumb.attr('alt').length) {
   desc = '';
   };

to have only the img title text appearing in the description bar.

I'm not sure how to solve this in a clean way without hacking the ad-gallery js file.