Skip to:
Content

#4436 closed enhancement (fixed)

Secondary Avatar Link

Reported by: jag1989 Owned by:
Milestone: 1.7 Priority: normal
Severity: normal Version: 1.2.6
Component: Activity Keywords: has-patch
Cc:

Description

I've been trying to wrap any secondary avatar in a link to that profile, group, event etc. I would like to use this within the activity stream, so that users can just click on the avatars to reach a destination. Currently BuddyPress only has the first avatar linked. However I would like the secondary to be 'linkable', and any further avatars within the activity.

See Here: (http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/wrapping-secondary-avatar-with-link/)

After posting this Boone stated that because there are not enough filters within a particular hook to get the information I need.

Here's another quick example:

On a fresh BP install, if one navigated to their activity feed where there were two avatars per activity item, only the first one would be linked. However the second one would be mid sentence and have a link next to it. I wanted to move this avatar next to the first one, and have it linked to the appropriate destination.

Attachments (1)

4436-secondary-avatar-link.diff (2.6 KB) - added by transom 18 months ago.
Better handling of link class option

Download all attachments as: .zip

Change History (8)

comment:1 DJPaul20 months ago

  • Component changed from Core to Activity
  • Milestone changed from Awaiting Review to 1.7
  • Severity changed from major to normal
  • Version changed from 1.6 to 1.2.6

I think this involves changing/adding filters in bp_get_activity_secondary_avatar()

comment:2 DJPaul20 months ago

  • Keywords needs-patch added; needs-ui removed

comment:3 transom19 months ago

  • Keywords has-patch added

Add optional argument to bp_get_activity_secondary_avatar - (bool) "linked", if true, wraps the secondary avatar with a link to the corresponding object.

Add two new filters:

bp_get_activity_secondary_avatar_link - passed the URI of the computed link to the object
bp_get_activity_secondary_avatar_link_class - passed an empty string that is added as a class to the link

comment:4 DJPaul18 months ago

  • Keywords needs-patch removed

transom18 months ago

Better handling of link class option

comment:5 transom18 months ago

Added new version of patch with better handling (use case) of the class attribute for the optional link applied to the secondary avatar. This patch removes the bp_get_activity_secondary_avatar_link_class and adds another optional argument "link_class". The value of the provided "link_class" argument is added to the secondary avatar link (default value is "")

comment:6 boonebgorges18 months ago

Thanks for the patch, transom. This approach generally looks good - linking the secondary avatar seems like a pretty common request, so I'm happy to add the 'linked' option in addition to the filters. I'll have a closer look in the upcoming weeks (unless another core dev gets to it first)

comment:7 johnjamesjacoby17 months ago

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

(In [6607]) Add ability to link secondary avatars in activity streams. Props jag1989. Fixes #4436.

Note: See TracTickets for help on using tickets.