Closed (fixed)
Project:
Gallery formatter
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2012 at 17:01 UTC
Updated:
28 Oct 2013 at 01:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
cwithout commentedSeconded. (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.
Comment #2
aaronbaumanFiles 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.
Comment #3
aaronbaumanAs 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.
Comment #4
manuel garcia commentedIf 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 :
To be:
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.
Comment #5
philsward commented@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...
Comment #6
kscheirerLooks like a valid solution is posted in #4?