Provide better ALT Names on images.

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Provide better ALT Names on images.

Post by Dragosvr92 »

Hello, I know that phpbb provides alt="Image" on images, just so it Will Validate the HTML Code.
I know That for SEO Reasons its better to provide a ALT Which Describes the Image, so it will be found On search Engines.

You could just add as ALT, The Image Name. It shouldnt be too hard.
What do you think ?
Previous user: TheKiller
Avatar on Memberlist 1.0.3

/a3
Registered User
Posts: 97
Joined: Mon Sep 20, 2010 6:44 am

Re: Provide better ALT Names on images.

Post by /a3 »

I don't see SEO as a reason to accept anything.

Using the alt attribute is, however, better for blind people and for accessibility reasons (which is probably why search engines have made it a factor in search engine ranking). ;)
$ git commit -m "YOLO"

User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Re: Provide better ALT Names on images.

Post by Dragosvr92 »

/a3 wrote:probably why search engines have made it a factor in search engine ranking). ;)
A reason would be that they can decide from the alt description what the image is about, and find it in a Search.
Also, i think it would be ridiculous simple to get the name of the image and put it into the alt element.
Should be considered if the extension should be removed or not though.
Previous user: TheKiller
Avatar on Memberlist 1.0.3

/a3
Registered User
Posts: 97
Joined: Mon Sep 20, 2010 6:44 am

Re: Provide better ALT Names on images.

Post by /a3 »

Like I said, I do agree with you. I just realised, you are correct about Google using the alt attribute for image searches.

I was just against the use of "SEO" as a reason for adding the alt attribute for images.

The biggest problem would be that changing such behaviour would break BBCode compatibility with boards that use the "standard" BBCode. However, I do think the pros outweigh the cons. I'm sure it would be possible in a conversion to change the BBCode structure as well.

I believe it has been discussed before, but the best way to implement would probably be the following change:

Instead of

Code: Select all

[img]http://www.example.com/image.png[/img]
use

Code: Select all

[img=http://www.example.com/image.png]Alternative Text[/img]
$ git commit -m "YOLO"

User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Re: Provide better ALT Names on images.

Post by Dragosvr92 »

hum... I dont think it would break the phpbb BBcode System.
The IMG BBCode already uses the alt and loads the alt from the image file, from something like :

Code: Select all

'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
Changing the $user->lang['IMAGE'] With something that loads the filename instead, for example whats between the extension and slash.

http://www.example.com/myimage.png

I guess there might be some other things to care of, like different urls with no extension, but i think the phpbb team is familiar with all the things.....
Previous user: TheKiller
Avatar on Memberlist 1.0.3

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: Provide better ALT Names on images.

Post by Arty »

Image file names usually describe what image does, like logo.png is for logo, smilie.gif is for a smilie. Maybe take file name, strip path and extension, replace separators _-. with space and use it as alt text?

That would result in code like this:

Code: Select all

<img src="whatever/logo.png" alt="logo" />
<img src="whatever/site_logo.png" alt="site logo" />

User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Re: Provide better ALT Names on images.

Post by Dragosvr92 »

CyberAlien wrote:Image file names usually describe what image does, like logo.png is for logo, smilie.gif is for a smilie. Maybe take file name, strip path and extension, replace separators _-. with space and use it as alt text?

That would result in code like this:

Code: Select all

<img src="whatever/logo.png" alt="logo" />
<img src="whatever/site_logo.png" alt="site logo" />
Yeeepp !!!
Thats exactly how it should function like !
It could be a option that users may chose, if phpbb dosnt feel it should be enabled.
Previous user: TheKiller
Avatar on Memberlist 1.0.3

/a3
Registered User
Posts: 97
Joined: Mon Sep 20, 2010 6:44 am

Re: Provide better ALT Names on images.

Post by /a3 »

TheKiller wrote:hum... I dont think it would break the phpbb BBcode System.
The IMG BBCode already uses the alt and loads the alt from the image file, from something like :
I know, but all of the BBCodes would have to be somehow changed so that they can allow for a BBCode-style ALT attribute.

Code: Select all

[img]http://www.example.com/image.png[/img]
is not the same as a BBCode that does allow ALT text, such as

Code: Select all

[img=http://www.example.com/image.png]Alternative text[/img]
$ git commit -m "YOLO"

User avatar
sooskriszta
Registered User
Posts: 85
Joined: Wed Dec 29, 2010 7:23 pm

Re: Provide better ALT Names on images.

Post by sooskriszta »

Why can't it be like the url bbcode?
http://www.phpbb.com/community/faq.php?mode=bbcode
Both

Code: Select all

[url=http://www.phpbb.com/]Visit phpBB![/url]
[url]http://www.phpbb.com/[/url]
are allowed.

Can't the same be done for img without breaking anything?
OC2PS
Testfestés, Arcfestés, Csillámfestés

Alapanyagok, Képzések, Ismertetők
Hennafestés
GMAT coaching and MBA Admissions Consulting
formerly known as sooskriszta

User avatar
sooskriszta
Registered User
Posts: 85
Joined: Wed Dec 29, 2010 7:23 pm

Re: Provide better ALT Names on images.

Post by sooskriszta »

Also, I would suggest that the alt text be duplicated into title text as well for tooltips.
OC2PS
Testfestés, Arcfestés, Csillámfestés

Alapanyagok, Képzések, Ismertetők
Hennafestés
GMAT coaching and MBA Admissions Consulting
formerly known as sooskriszta

Post Reply