Skip to:
Content
Pages
Categories
Search
Top
Bottom

how is the autocomplete list for mentions compiled?

  • @gyrus

    Participant

    I’m trying to work out the mentions functionality. I thought that in groups the autocomplete list was basically from other members of the group. This sometimes seems to be the case, but it’s erratic. Sometimes it’s different in activity comments compared to activity updates in the same group.

    It’s so erratic that I can’t really provide steps to replicate. Maybe it would be easier if I knew where it was compiling the list, so I can see the underlying logic – and maybe step in with a hook to customise things?

Viewing 9 replies - 1 through 9 (of 9 total)
  • @prashantvatsh

    Participant

    Hi,

    For mention feature we have a javascript file there https://github.com/buddypress/BuddyPress/blob/master/src/bp-activity/js/mentions.js

    You can look at it.

    @gyrus

    Participant

    I’ve looked. I was looking for more information, and have searched to no avail. It’s not documented anywhere?

    @prashantvatsh

    Participant

    If you can provide more info about the issue like screen-cast or something then I think will be easy to check.

    @gyrus

    Participant

    As I said, it’s too erratic to replicate easily. At the moment I can’t get it to do anything other than suggest group members, which is what I expected. But before I posted this it was sometimes the list missed group members, sometimes it included all site members. Sometimes it was different in updates compared to comments, sometimes not.

    I’m hoping it won’t be something that results in disabling the feature completely being the preferred option (seems to be a common request out there due to members finding the feature confusing).

    But for now all I can do is experiment with hacking mentions.js and seeing if I can find anything. I just wondered if any systematic approach to taming it had been found.

    @prashantvatsh

    Participant

    @gyrus

    Participant

    I was thinking of developer docs rather than guides to the user interface – but thanks anyway.

    @prashantvatsh

    Participant

    @gyrus

    Participant

    Thanks. It turns out bp_before_get_suggestions_parse_args was the filter I was looking for, applied to the bp_core_get_suggestions() function’s args. Since it’s called from AJAX, you need to parse $_SERVER[ 'HTTP_REFERER' ] to find out where it’s being called from, but then you can pass args through to BP_Members_Suggestions or BP_Groups_Member_Suggestions.

    @prashantvatsh

    Participant

    Great to know that 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar