How can I change the alt= text?

mriffey

Joined: 2006-06-22
Posts: 8
Posted: Wed, 2007-03-21 07:21

If possible, I need to replace the alt='filename' with alt='keyword/description info from a custom field or from the photo description or keywords'

I dont see any straight forward way of doing this after digging around in the templates and classes for a while. Is this possible?

Mark

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2007-04-06 05:17

modules/core/classes/GalleryPhotoItem.class and GalleryDerivativeImage.class are where the alt text is rendered.

 
mriffey

Joined: 2006-06-22
Posts: 8
Posted: Fri, 2007-04-06 06:09

thanks mindless, i finally tracked it down. Not too bad to change unless youre using frames. then it gets complicated:)

 
stukoch

Joined: 2006-01-20
Posts: 33
Posted: Fri, 2007-04-06 21:18

I just added the following to photo.tpl

{g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%" alt=$theme.item.keywords}
		{/g->container}
	      {else}
		{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback alt=$theme.item.keywords}
 
mriffey

Joined: 2006-06-22
Posts: 8
Posted: Fri, 2007-04-06 23:05

Thanks stukoch, Ill give that a try. Part of the issue for me is that I have to parse the image name, decode it into english (such as a photog name and a subject type) and then put all that stuff into the alt tag. Result: A nice long switch statement for both. I was under the impression that the alt tag was already getting place in there but I may have misread the code. Appreciate the heads up:)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2007-04-07 14:50

if you provide alt=".." in a {g->image ...} it overrides the default alt text.

 
mriffey

Joined: 2006-06-22
Posts: 8
Posted: Sat, 2007-04-07 16:18

Thanks again mindless. You would have thought that was obvious, but its one of the things I didnt try:)

 
xremongin

Joined: 2007-05-25
Posts: 1
Posted: Fri, 2007-05-25 00:12

Hello,

I try this but I not succesfull. Is any one have a example to show me? or experience of this trip?

Thanks

 
net4earning
net4earning's picture

Joined: 2007-06-02
Posts: 202
Posted: Fri, 2007-06-15 12:04

thanks mindless and stukoch.
i tried this on PHOTO.tpl and it worked. and i also added <TITLE> attribute in <IMG> and it also worked.
however when i added <TITLE> attribute in ALBUM.tpl it worked but when i try to change this to parent+item it doesn't work.
like if album is top album and it has to child album say 1 and 2.
when we hover on any of this item it shows respective item name.thats fine.
now what i want is, when i hover on 1 it should show top album - 1.
i tried various combinations but failed.

------------------------------------------------------------------------------------------------------------------
www.net4earning.com