Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#2606 closed defect (bug) (fixed)

[patch] Improve avatar HTML alt tag. And add title parameter.

Reported by: djpaul's profile DJPaul Owned by: djpaul's profile DJPaul
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Core Keywords: has-patch
Cc:

Description

At the moment, all of the user/group/blog avatars have alt tag text of "Avatar", "Group Avatar", "Avatar Image." For a social network, this is not ideal as typically a single site will have many images which represent a person, group or other object.

The attached patch, against branch 1.2, tries to improve the alt text for all avatars used in a BuddyPress installation. It also adds a title tag parameter to the relevant avatar functions to add a tooltip to visual browsers supporting hover states to "label" the image.

Attachments (3)

2606.patch (7.5 KB) - added by DJPaul 15 years ago.
v1
2606-2.patch (9.0 KB) - added by r-a-y 15 years ago.
2606-3.patch (17.7 KB) - added by DJPaul 15 years ago.

Download all attachments as: .zip

Change History (12)

@DJPaul
15 years ago

v1

@r-a-y
15 years ago

#1 @r-a-y
15 years ago

Great first patch, Paul.

I've repatched it to:
-add "alt" tags for avatars in bp-forums-templatetags.php
-removed esc_attr() for "bp_core_avatar_alt" and the filters as the respective components already apply wptexturize(), wp_filter_kses(), etc.
-removed "'blog' == $object" from "alt" attribute conditional, since blog avatars do not currently exist
-cleaned up some of the "alt" attribute strings

Let me know what you think.

@DJPaul
15 years ago

#2 @DJPaul
15 years ago

The new patch adds alt tags to more avatars throughout the site. I believe we have them all.

-I added the "'blog' == $object" bit back in as group activity stream entries uses it.
-I had to treat the activity steam avatars differently.
-Activity stream group avatars have an alt tag of "Group avatar", this is because there's currently no way of getting the group name without returning the group object (per your patch); this'd add a query per group avatar in the activity stream, which isn't awesome.

The strings we now have are:
-"picture of ..." for all member avatars.
-"blog avatar of ..." for blog activity stream avatars / "blog authored by ..." for blog directory avatars.
-"group avatar for ..." for group directory, group pages and forum directory.
-"group avatar" for group activity stream avatars (note no insertion of group name).

I don't think the word "avatar" is something we want here. I'm not sure how many non-geeks will know what an "avatar" is in this context. What would we change it with? Thoughts?

#3 @paulhastings0
14 years ago

  • Summary changed from Improve avatar HTML alt tag. And add title parameter. to [patch] Improve avatar HTML alt tag. And add title parameter.

#4 @DJPaul
14 years ago

Ray, did we get this 100%?

#5 @r-a-y
14 years ago

I believe we got everything. Might need a fresh set of eyes.

Agreed on the word "avatar". Not sure what would be a better word... "picture" is too generic for groups and blogs. "icon" perhaps?

Also, if blog avatars are not going to make it in BP 1.3, then it might be wise to remove secondary avatars for blogs from the activity stream.

#6 @DJPaul
14 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

#7 @boonebgorges
14 years ago

Patch looks solid to me.

#8 @djpaul
14 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [3635]) Improves avatars' HTML alt and title tags. Fixes #2606.

#9 @DJPaul
14 years ago

For the record, I settled on "group logo of", "profile picture of" and "blog authored by."

Note: See TracTickets for help on using tickets.