What file do I edit to add the title attribute to image links. The alt attribute is already there. I tried searching through the core module for this information, but can't find it and really have no clue as to where to start except at gallery2/.....
Posts: 8601
if you want to add it in a particular place you can pass title= in the g->image.
if you want to modify all of them, edit modules/core/classes/GalleryPhotoItem.class and GalleryDerivativeImage.class, function render().
Posts: 16504
Are classes similar to templates where I should make a local directory so I don't have to worry about them getting written over?
Posts: 8601
nope, sorry.. you'll have to manage changes you make to classes..
Posts: 16504
No problem. Thanks for the info. It worked perfectly!
Posts: 8
sorry, i think i didnt understood. how to make the names of images in alt attributes, so I see the name on mouseover?
Posts: 16504
edit: I've added a feature request for this that can be found here, https://sourceforge.net/tracker/index.php?func=detail&aid=1198718&group_id=7130&atid=357130. There's an attached file with all the modifications needed to 29 files to make these changes.
Edit the two files mindless mentions above. Towards the bottom of each file there is a function defined named render It starts with this:
/** * @see GalleryDerivative::render() */ function render($format, $item, $params) {Find these lines towards the lower portion of that function:
if (!isset($params['alt'])) { $params['alt'] = $item->getTitle() ? $item->getTitle() : $item->getPathComponent(); } if (!isset($params['longdesc'])) { $params['longdesc'] = preg_replace('/[\r\n]+/', ' ', $item->getDescription()); }and add these lines of code
if (!isset($params['title'])) { $params['title'] = $item->getTitle() ? $item->getTitle() : $item->getPathComponent(); }The result should look something like this
if (!isset($params['alt'])) { $params['alt'] = $item->getTitle() ? $item->getTitle() : $item->getPathComponent(); } if (!isset($params['title'])) { $params['title'] = $item->getTitle() ? $item->getTitle() : $item->getPathComponent(); } if (!isset($params['longdesc'])) { $params['longdesc'] = preg_replace('/[\r\n]+/', ' ', $item->getDescription()); }