Page 1 of 1
No alt tag for images
Posted: Sat Jan 13, 2007 9:06 pm
by abdussamad
I think I found a bug in the s9y media manager including the one included with 1.1. The alt tag is not included for images inserted via the media manager. This breaks xhtml validity. Usually this occurs when thumbnails of images linking to the full sized version are inserted.
Re: No alt tag for images
Posted: Sun Jan 14, 2007 1:50 pm
by garvinhicking
Hi!
In the serendipity_editor.js, which is responsible for inserting those <img>s there's always an alt tag (even though its empty).
Can you show us an example blog entry where you find this behaviour?
Best regards,
Garvin
Re: No alt tag for images
Posted: Sun Jan 14, 2007 4:06 pm
by abdussamad
garvinhicking wrote:Hi!
In the serendipity_editor.js, which is responsible for inserting those <img>s there's always an alt tag (even though its empty).
Can you show us an example blog entry where you find this behaviour?
Best regards,
Garvin
I think the alt attribute to the img tag is missing:
http://cricketgame.info/archives/8-testing-s9y.html
http://validator.w3.org/check?verbose=1 ... g-s9y.html
Re: No alt tag for images
Posted: Sun Jan 14, 2007 4:11 pm
by garvinhicking
Hi!
Are you using the WYSIWYG editor to insert this link? It might be that the editor is stripping empty tags?!
Best regards,
Garvin
Re: No alt tag for images
Posted: Sun Jan 14, 2007 7:46 pm
by abdussamad
garvinhicking wrote:Hi!
Are you using the WYSIWYG editor to insert this link? It might be that the editor is stripping empty tags?!
Best regards,
Garvin
Yeah I think your right. IF I use the standard editor the alt attribute is there. So I guess the media manager should specify some alt text? Perhaps the path to the image or the file name?
Posted: Sun Jan 14, 2007 8:21 pm
by carl_galloway
As we move forward to v1.2 I'd like to see a title for the image which can be automatically inserted into the alt field. Some users wouldn't give their images a title but abdussamad's suggestion of using the file name is worth considering. Can we also add a title and description for the folders within the uploads directory? I know this has been mentioned somewhere else but I can't find it right now.
Posted: Mon Jan 15, 2007 8:41 am
by garvinhicking
Hi!
Specifying an ALT/Title-Attribute is a good request, but it's rather painfully to implement and might take a while.
Implementing "path" properties is even more painful, as we need to create a completely new table for that and change all queries that are related to path permissions.
Most of the work on the 1.1 gallery was sponsored by a customer, and since he doesn't need those features, chances are it might take me a longer time to find free time for implementing them.
Best regards,
Garvin
Posted: Mon Jan 15, 2007 5:41 pm
by abdussamad
Well something is better than nothing and so a small change to serendipity_editor.js results in the path to the image file being set as the alt text (s9y1.1 lines 210-218):
Code: Select all
if (f['serendipity[align]'][0].checked == true) {
img = "<!-- s9ymdb:" + imgID + " --><img width='" + imgWidth + "' height='" + imgHeight + "' " + (styled ? 'style="border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + '\" alt=\"' +img +'\" />';
} else if (f['serendipity[align]'][1].checked == true) {
img = "<!-- s9ymdb:" + imgID + " --><img width='" + imgWidth + "' height='" + imgHeight + "' " + (styled ? 'style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + '\" alt=\"' +img +'\" />';
floating = 'left';
} else if (f['serendipity[align]'][2].checked == true) {
img = "<!-- s9ymdb:" + imgID + " --><img width='" + imgWidth + "' height='" + imgHeight + "' " + (styled ? 'style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + '\" alt=\"' +img +'\" />';
floating = 'right';
}
In case anybody is interested you can download the file
for s9y1.1 here. For 1.0
here
Posted: Wed Apr 09, 2008 12:16 pm
by schimanke
Though this posting is already more than a year old, I'd like to bring the topic back on top. I am still missing an automated setting of the alt-tag when inserting an image using the WYSIWYG editor. Will there be anything inthe future?
Posted: Wed Apr 09, 2008 12:38 pm
by garvinhicking
Hi!
No volunteers yet showed up for implementing this. The code foundation etc. is all there, it can be solved with a plugin.
Regards,
Garvin
Re: No alt tag for images
Posted: Sat Feb 28, 2009 10:52 am
by julianhopkins
Hi, sorry if this is a dumb question, but is there any way to put in ALT text manually? Is it in the image properties?
Re: No alt tag for images
Posted: Sat Feb 28, 2009 3:36 pm
by Don Chambers
julianhopkins wrote:Hi, sorry if this is a dumb question, but is there any way to put in ALT text manually? Is it in the image properties?
It is not a dumb question. If you are using the wysiwyg editor, there is a button that looks like a page with < > on top of it... this toggles between wysiwyg and html model... toggle it to html mode and you can enter the ALT text manually.
Re: No alt tag for images
Posted: Sun Mar 01, 2009 12:13 am
by julianhopkins
OK got it

Thanks! So basically, I just enter it in every time I am putting a picture into my post.
For anyone out there who, like me, wasn't sure where the proper place was to put the alt tag, here is an example (the alt tag text in red)
<img class="serendipity_image_center" width="466" height="300" src="/uploads/jh_pic_090227_BombGaza.jpg" alt="Unexploded bomb in Gaza" />
Re: No alt tag for images
Posted: Mon Mar 02, 2009 8:54 am
by konus
I really would LOVE the possibility to enter the alt tag in the mediamanager
