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

julou’s picture

What 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:

getImageCaption: function(el) {
	return el.getAttribute("alt");
}

Does this do the job?

designguru’s picture

Status: Active » Fixed

Good 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./

designguru’s picture

julou - 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./

julou’s picture

On 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.

designguru’s picture

Thanks - I see the custom config area...

julou, even then - how can I get both the title and description to display?

q./

julou’s picture

A simple solution would be something like

getImageCaption: function(el) {
	str = el.getAttribute("title") + ' - ' + el.getAttribute("alt");
	return str;
}

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.

julou’s picture

Status: Fixed » Needs work
ParisLiakos’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)