Alt tags for images

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Get Involved
Post Reply
urzh
Registered User
Posts: 52
Joined: Mon Aug 05, 2019 1:51 pm
Name: Robert

Alt tags for images

Post by urzh » Sat Aug 10, 2019 2:25 pm

Hi,
By default I see phpBB will add alt tags to images based on the file name which I think should be ok, including dashes. Is there anything that better controls this or is this the standard by default and will work fine for all sites?

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21333
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: Alt tags for images

Post by Mick » Sat Aug 10, 2019 4:35 pm

What images are you talking about?
urzh wrote:
Sat Aug 10, 2019 2:25 pm
will work fine for all sites?
What do you mean by that? I think you need to expand on your question.
"The more connected we get the more alone we become" - Kyle Broflovski

urzh
Registered User
Posts: 52
Joined: Mon Aug 05, 2019 1:51 pm
Name: Robert

Re: Alt tags for images

Post by urzh » Sat Aug 10, 2019 10:54 pm

Is the way phpBB handles alt tags by default acceptable to Google now without the need for an extension?

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3261
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Alt tags for images

Post by thecoalman » Sun Aug 11, 2019 1:32 am

The alt tag is supposed to describe the image, not the file. This is used in place of the image if for example the user is using screen reader or text browser. The primary issue is you would need the user uploading the file to use a proper description and of course a text box to put it. So yes you would need extension or modification to get proper alt tags for images. The current way it is handled is neither good for the reader or search engines.

More info here from someone that would use such a feature, he notes the cons and pros.

viewtopic.php?f=64&t=2403786&hilit=alt& ... #p14799936

User avatar
3Di
Former Team Member
Posts: 13920
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Alt tags for images

Post by 3Di » Sun Aug 11, 2019 2:21 am

The ALT tag for attachments is generated if you put a File comment for it, the resulting HTML is
<img src="./download/file.php?id=x" class="postimage" alt="real_filename" onclick="viewableArea(this);">
The alt tab contains the realfilename, ie.: my_awesome_image.png

Instead the IMG bbcode doesn't allow to insert an ALT tag if not using this extension
viewtopic.php?f=456&t=2518201
still in dev, though the code looks good IMHO.

Edit, is generated using the wrong real_filename instead of the comment.
I am going to amend this behaviour with a PR.

https://tracker.phpbb.com/browse/PHPBB3-16129 / the PR uses the comment if present else falls back to the filename.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

urzh
Registered User
Posts: 52
Joined: Mon Aug 05, 2019 1:51 pm
Name: Robert

Re: Alt tags for images

Post by urzh » Sun Aug 11, 2019 2:49 pm

Yes, I see the alt tags getting generated without defining them based on my file name. But with reading online, this seems OK to Google index.

Yes, would be very nice to be able to manipulate the alt tag in BBcode. But honestly, someone registering and posting on a forum won't know to do this, so I like the file name based alt tags much better

Post Reply

Return to “phpBB Discussion”