Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I may have missed something but when using this module with a View, I haven't seen any options anywhere to display the alt or description fields for imagefields.
The Colorbox module by contrast seems to take the imagefield alt data and automatically use it as a title when a View calls a colorbox-powered slideshow/lightbox - might be worth taking a peek to see how their code facilitates that.
Have I overlooked something?
Thanks,
Qasim
Comments
Comment #1
julou CreditAttribution: julou commentedWhat do you mean by "using this module with a View"? Is it displaying several nodes on a single page?
Normally, you can control which element is passed as title with the config options:
by default it is using the title data, but you can change it to use the alt data:
Does this do the job?
Comment #2
designguru CreditAttribution: designguru commentedGood stuff - I think this is what I was looking for... I decided to just enable image titles instead of trying to make alt tags serve a dual purpose (of both alt/seo + an image title).
I can see image titles at the top of the photoswipe interface.
q./
Comment #3
designguru CreditAttribution: designguru commentedjulou - I tried editing the above to replace "alt" with "description" in the photoswipe.module file - I'd ideally like to print the title and the description of each image, if they've been entered. Adding the word 'description' didn't do anything though.
How can I add the image description to photoswipes?
Thanks,
q./
Comment #4
julou CreditAttribution: julou commentedOn the config page (admin/settings/photoswipe), there is a text field "Custom configuration"…
You are not supposed to change the module file, just the text in this field (modifying or adding the getImageCaption property).
If you don't have such a text field, please update your module.
Comment #5
designguru CreditAttribution: designguru commentedThanks - I see the custom config area...
julou, even then - how can I get both the title and description to display?
q./
Comment #6
julou CreditAttribution: julou commentedA simple solution would be something like
But apparently, el.getAttribute("alt") does not work! I have to look at it further to understand whether photoswipe grab the attributes for the a tag or from the img tag… If you can fix it, a patch is more than welcome.
Comment #7
julou CreditAttribution: julou commentedComment #8
ParisLiakos CreditAttribution: ParisLiakos commented