Adding Title Attribute to Images

Loreauville Phil

Joined: 2011-08-20
Posts: 10
Posted: Tue, 2013-11-19 03:35

I have a hard time believing this question hasn't been asked, but I can't find it anywhere on the forums.
How can I add the title attribute to images in my gallery?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-11-19 09:53

Same place you add the description. Edit photo.
If you want to do a bunch at a time there is the captionator module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Loreauville Phil

Joined: 2011-08-20
Posts: 10
Posted: Tue, 2013-11-19 14:59

No, that's not what I'm talking about.
The title attribute in the img tag of the html, <img src="picture.jpg" alt="my picture" title="this is My Picture" />, the "tool tip" that displays when you hover your mouse over the image. All that I get now is "View Full Size".
Will that Capionator do it?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2013-11-20 01:23

Ah now I know what you mean.
That is hard coded to the theme as when you click the resized image you get the full sized.
You can see the text in themes/<your theme>views/photo.html.php
Change <?= t("View full size")->for_html_attr() ?>
to
<?= $item->title ?>
or not tested:
<?= t("View Full size: %item_title", array("item_title" => $item->title))->for_html_attr() ?>

Now your a theme developer!

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Loreauville Phil

Joined: 2011-08-20
Posts: 10
Posted: Wed, 2013-11-20 02:17

Thank you!
I will give it a try and let you know how it turns out.