Alt tag - description rather than title

broadcast_techie

Joined: 2008-08-29
Posts: 3
Posted: Sun, 2012-09-16 13:52

As an attempt to improve my visibility to Google et al. I have modified modules/gallery/models/item.php line 657 to read:
"alt" => ($this->description ? $this->title . " - " . $this->description : $this->title ),

Note: this is in the resize_img function which displays the preview image on a page.

How do I suggest that this makes it into the mainstream (if it is indeed useful to other people)?

Kris

 
broadcast_techie

Joined: 2008-08-29
Posts: 3
Posted: Sun, 2012-09-16 13:54

"alt" => ($this->description ? $this->title . " - " . $this->description : $this->title ),

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-09-16 14:00

You'd have to strip/escape descriptions as they can contain html

-s
All New jQuery Minislideshow for G2/G3

 
broadcast_techie

Joined: 2008-08-29
Posts: 3
Posted: Sun, 2012-09-16 14:07

good point (in my case I know they don't...)

Is there a built in function to do this? I'm not used to kohana etc. Am also open to to better methods of implementing this!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-09-16 14:30

I think purify:
html::purify($item->description)

or clean /modules/gallery/helpers/MY_html.php

-s
All New jQuery Minislideshow for G2/G3

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-09-16 17:55
Quote:
How do I suggest that this makes it into the mainstream (if it is indeed useful to other people)?

File an enhancement request: https://sourceforge.net/apps/trac/gallery/newticket with either your patch or best bet a fork on github with a pull request.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team