I upgraded to 7.x-1.2 and found that that alt tag was also being displayed as caption. I would think that you only want the alt tag to be in the img "alt" tag and the title to be the caption displayed the user.

I know it has to do with this fix that went in: http://drupal.org/node/1232802

For the time being I deleted the line 31: <?php if ($data['alt']): ?><h4><?php print $data['alt']; ?></h4><?php endif; ?>

Comments

cwithout’s picture

Seconded. (actually 4th, since there are 2 additional agreements on the original issue.)

The alt tag on an image shouldn't be visible by default. I'm not sure why that was considered a bug. It would be better to provide a configuration option for whether to show alt, title, both, or neither.

aaronbauman’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

Files are fieldable in Drupal 7.
There's no reason to re-purpose "alt" or "title" properties.
Galleryformatter should allow any arbitrary field, or multiple fields, on the file entity to be used as caption or descriptive text.

"Alt" is explicitly defined as "alternative" text, to be used only when the image is not rendered (ie. screenreaders).
Rendering alt text as a caption is a hack, and could reasonably be considered UI bug.

aaronbauman’s picture

Status: Active » Needs review
StatusFileSize
new495 bytes

As a stop-gap to actual fields support, a quick and easy way to give themers and developers a way to solve this problem is to include the original file in the theme function.

One-line patch attached, which passes the field item along to the theme invocation.

Currently, there's no way to divine any file information from within the template file.
This patch empowers anyone to use the original file in the template file, without changing any existing behavior, by passing the filefield "item" along with the slides.

manuel garcia’s picture

If you don't want the alt text being printed in the caption, you only need to override the tpl file in your theme, and change :

<div class="panel-overlay">
              <div class="overlay-inner">
                <?php if ($data['alt']): ?><h4><?php print $data['alt']; ?></h4><?php endif; ?>
                <?php if ($data['title']): ?><h3><?php print $data['title']; ?></h3><?php endif; ?>
              </div>
            </div>

To be:

<div class="panel-overlay">
              <div class="overlay-inner">
                <?php if ($data['title']): ?><h3><?php print $data['title']; ?></h3><?php endif; ?>
              </div>
            </div>

I understand that passing in the whole file item into the tpl would empower even more the theme layer, but as far as I see it, it isn't necessary... at least not just to not print the alt.

philsward’s picture

@Manuel Garcia thx for pointing this in the right direction. Very simple edit.

To further explain #4:

Edit the "Gallery Formatter Template" file called galleryformatter.tpl.php located at: /sites/all/modules/galleryformatter/theme/

---

I personally would love to see this added as options within the module. It's a pain to keep track of what modules (theme files) you've modified when you're dealing with a bunch of different sites. Updating galleryformatter through drush will overwrite any changes made to the theme, causing it to break on all future updates. Bummer...

kscheirer’s picture

Status: Needs review » Fixed

Looks like a valid solution is posted in #4?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.