Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
2.0.X - Userprofile Image alt="username userpicture" integration
phreak
MVP
Hi all,
I have a pretty side issue for an old Vanilla, but still its important. I'd like to add an alt-Tag to every userimage uploaded on the userprofile page. This alt-tag should hold the username and the word userpicture.
I wandered trough the files but i'm not clear how Vanilla is creating the image or at least this alt tag.
Can anyone point me to a solution, thanx.
- VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
- VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
Tagged:
0
Comments
I guess you need to copy that file to your theme:
https://github.com/vanilla/vanilla/blob/2.0/applications/dashboard/views/modules/userphoto.php
Hi R_J, thanx i found the file also. But i don't know how the implementation of an alt-Tag would work here.
Thanx
phreak
The function Img takes an "attributes" argument, so that you could use it like that:
It might be enough to save the modified version into
/themes/yourtheme/modules/view/userphoto.php
but I'm not sure about that.Works like scientific. Thaaanx!
@R_J: Coudl help me out a 2nd time. This time i found out that the ALT-Tags is also missing in 2.1. I tried a little around and it looks like variables have changed as doesn't work anymore.
'alt' => $this->User->Name.' userpicture'
Thanx for help.
The alt tag houses the name of the user in 2.1 it is there. Not missing.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder: Not on the Profile Page.
Because it is linked to change profile picture editor not the profile. I think the image serves as a place holder more than anything else. It uses Id not name...
<a href="/forum/profile/picture?userid=1" class="ChangePicture"><span>Change Picture</span></a>
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
I think the last comment does what you want. I tested it and it works.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Actually this worked for me to add an alt
this is the result
<img src="http://www.vrijvlinder.com/forum/uploads/userpics/392/pOERLIYVR58Z0.jpg" class="ProfilePhotoLarge" alt="UserImage">
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
If you want the name of the user to be the ALT use this
Result of this
<img src="http://www.vrijvlinder.com/forum/uploads/userpics/392/pOERLIYVR58Z0.jpg" class="ProfilePhotoLarge" alt="VrijVlinder">
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Thank you @vrijvlinder. I think this should go into the Core. Would you like to do a pull request?
I am not sure I can do that not sure how, but if anyone else wants to do it go for it.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@phreak
From the announcement at the top of the page:
@whu606: It also targets 2.1. My SEO tool says that 5.000 profile pages with missing alt tags on the profile picture is not too god.
I did not know not having this was detrimental to seo.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌