I have a new install of 2.0 and I am using the Siriux theme. The default theme seems too busy so I am trying to tweak Siriux. It displays the thumbnails nicely without any of the date, new, owner and other shite around it but it would be nice to be able to mouse over the thumbs and get the description or title to come up when in the thumbnail view. Right now all you see it just a clean page of thumbs with nothing around them. Nice but too simple me thinks.
Looking at the html code I see:
<img src="http://xxxxxxxxx/photo/d/385-2/P9010297.JPG" width="150" height="112" alt="Title of Pic" longdesc="Sunset - early bird gets the worm. On the road to Ft Collins"/>
So for firefox to show mouse over info it needs the TITLE element in the IMG tag. How / where can I add this info ??? I don't know about IE and think the mouseover thingy may work but I and my pals use good old Firefox so please let me know.
Thanks
G2 rocks now if we could just have some usable more SIMPLE themes!
Posts: 32509
title=?
img tags have the alt="This is a text that shows up when you keep your mouse over the image or if the browser cannot display images" attribute.
and the longdesc attribute.
and g2 already has this option built in. you just need to enable it.
in themes/siriux/templates/album.tpl , replace
{g->image item=$child image=$child.thumbnail}
with{g->image item=$child image=$child.thumbnail alt=1 longdesc=1}
i thing that should work.
btw: look at PG's theme on the user contribution page of codex.gallery2.org, it's great.
Posts: 16504
Actually the alt attribute is not for that, that's what IE incorrectly uses it for. That "tooltip" popup when you hover your mouse over an image is suppose to be from the title attribute.
I submitted a patch for this a long time ago, but nothing happened with it.
http://www.w3.org/TR/REC-html40/struct/global.html#h-7.4.3
Posts: 5
Yes, as nivekiam correctly pointed out IE does handle this correctly. The fix mentioned in reply to my intial post works great -thanks!- but how do I populate the tag with usable data now, I end up getting the number 1 in all my title tags.
Thanks again
R
Posts: 5
Ok I figured it out I added title=$child.summary or I could do title=$child.description - works great, a nice clean theme but mouse over the thumbs and see the summary or description - or get fancy and have both - need to brush up on smarty to see how to concatenate two strings together. Also would be nice to add code to save if the silly program has used the xxxxxx.JPG for the title or summary / description then make the string blank so the mouse over will not return the file name that doesn't really mean anythiing to anyone.
Posts: 383
btw, IE does not show the alt attribute when the title attribute is present (empty or not) so my guess is Microsoft way back decided to try to "help" when the title element was missing and it then going wrong altogether. Ah well, at least it is looked at now in gallery, I was wondering about this as well...
Posts: 32509
RwD: so, something wrong with G2 does?
Posts: 383
not sure, depends on the intend;
The alt attribute is meant to display whenever the image cannot be found.
As it seems gallery knows that the alt attribute is required for the used dtd because every image has one. But the default header image in the matrix theme has an empty alt attribute causing IE to not show a tooltip, but even worse; when that image cannot be found the alternative text for that image is missing! By the empty alt attributes existing I am guessing galleries intend is to have the tooltip show.
If the intend isn't to show a tooltip then the titel attribute should most definately be in to stop the alt from showing in IE.
Euhm, basically gallery2 isn't really doing something wrong, neither is IE. But if you don't want the alt to show you need to add an empty title...
(am I making any sense??)
Posts: 16504
ThaboTheWuffDog, no I pointed out that IE does this INCORRECTLY ;)
RwD, this is what I've been trying to argue the entire time. The alt attribute was treated as the tooltip and to be there so it could pass HTML validation as it's a required attribute. But since it was used as a tooltip and 90% of browsers display it like that, then why not also use the title attribute with the same information so that all browsers display your gallery install the same way. Plus it would make using some features like Rearrange Items much easier ;)
Posts: 32509
please file a feature request or bug then, whatever you feel is appropriate.
we start looking at the total page size. bharat wants to make all URLs relative which will save about 20% of the page size.
adding title's in all <img tags might blow it up again a little, but i guess it's worth it. in the end, we could also make it optional and for themers, it's an option anyway.
Posts: 383
nivekiam, Sorry, I must have not completely understood you. No need to repeat you ;)
Valiant, Hmmz, do you already use html compression to save space?? That is php side as well, right? Big part of the size comes from the lots of spaces in the output!! (saves 4Kb if I remove the extra spaces from a random small album page in the Matrix theme (two items, three sidebars)).
Posts: 32509
RwD we let the user decide, he can configure apache / php properly to use compression.
you'll get a problem with g2 progress bars though if you use compression.
Posts: 16504
RwD, no worries, I wasn't talking about you. Repeat all you want, others need to heard this cry for justice ;) I've been off and on bitching about this for a few months now.
valiant, ah that might explain why my progress bars don't work. All php on my site is gzipped...
I understand adding title's in will add to the overall page size, but I think it would be small and then would give everyone with different browsers (read more standards compliant than others :D ) the same experience. I did think about adding trying to add this as an option in the Site Admin, but then there would need to be a bit more code added to check for a variable and set a variable...
Posts: 32509
as i said, please file a request. people can now vote for requests, we'll see how popular this one is ;)
Posts: 16504
I did, 4 months ago ;)
http://sourceforge.net/tracker/index.php?func=detail&aid=1198718&group_id=7130&atid=357130
Look it's already got 5 votes :D
Posts: 32509
i wonder who voted for it, any chance it was you?
Posts: 21
Where exactly did you do this?
I would also like to know how to hover the description of a thumbnail in the mouseover text... I had a similar mod for a phpbb board that hovered the first 240 characters of the most recent post over the link to a post in the thread list... I just have no idea how to put it into G2. Even if you could tell me where it builds the img structure for the thumbnails, I could maybe piece it together...
{g->image id="%ID%" item=$child image=$child.thumbnail class="%CLASS% giThumbnail"}
I'm guessing that's what inserts the picture, but I have no idea how to change what it inserts...
R!
Posts: 21
Ok, I found a way to maybe do this, and it works pretty cool too...
Open modules\core\classes\GalleryDerivativeImage.class
Find at or near line 223:
Make an exact copy of that directly below itself, then in the second version change each occurance of longdesc to title. You should now have the following:
The code that follows it will automatically parse it into the html, because as long as the title param is set, it gets inserted. It also handles stripping out any odd characters, as well as cuts it to a manageable length if it's really long.
This actually works for ALL images! thumbnails, breadcrumbs, and even full size images! Enjoy!
R!
Posts: 21
I would like to add, I am also using the WPG2 (wordpress gallery 2) plugin, and this even made it so I get popups on my blog entry pictures, and even on the random image block on my main blog page.
This is the easiest way I could imagine to get so much at once :P
Edit: I would also like to add, sorry for necro'ing this old thread with my ramblings, however I felt it solved the problem perfectly and others might find it useful
R!