BuddyDev

Search

Combining notifications

  • Participant
    Level: Master
    Posts: 279
    NikB on #50693

    Hi there

    I’ve recently upgraded an existing Buddypress site with a new theme and consequently switched from using Buddypress Legacy to Nouveau.

    One thing I’ve noticed is that notifications (in the menu dropdown) don’t seem to get consolidated/combined as they did in the past eg. previously if I received two comments on an update, the text would appear as “You have 2 new replies”, whereas now they appear as two separate entries as “X commented on your update” and “Y commented on your update”.

    I’m trying to figure out whether this is as a result of changing from Legacy to Nouveau, perhaps the theme I am using or possibly even a setting I’ve missed somewhere.

    Any suggestions to point me in the right direction would be very much appreciated.

    With many thanks in advance
    Nik

  • Keymaster
    (BuddyDev Team)
    Posts: 24332
    Brajesh Singh on #50696

    Hi Nick,
    I did not notice it in Nouveau(assuming you are referring to the notification in the adminbar). I will re-check and confirm tomorrow.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    NikB on #50697

    Hi Brajesh

    Thank you for getting back to me. I don’t actually mean the adminbar (as far a I am aware, that only ever shows you a total number of notifications and you then need to click on that to view the details)?

    What I’m referring to is a bell icon in the menu bar which when clicked on shows a dropdown list of notifications, and which, in writing this, I am realising is controlled at least partly by the theme I’m using (although seems to be a fairly common feature of most Buddypress focused themes and uses the bp_the_notification function to populate the list).

    Hmmm… I guess it may be my theme that’s at fault and/or something to do with the bp_the_notification function so will investigate a bit further but any suggestions would be much appreciated.

    Note: what I am looking for is (for example) the text which is generated when a function such as bp_activity_format_notifications is run eg. a new activity reply should generate “X commented on one of your updates” if it’s the first one and “You have %1$d new replies” if you have more than one reply and that doesn’t seem to be happening… I just keep getting multiple entries of “X commented on one of your updates”.

    With many thanks as always
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on #50705

    Hi Brajesh

    Just thought I’d update on this as it seems the dropdown list of notifications I was referring to *was* controlled from the previous theme I was using. Essentially if a user has two “at mentions”, the old theme would show that as “You have 2 new mentions”, whereas the theme I am currently using shows two separate list items eg. “X mentioned you” and “Y mentioned you”. Of course, the latter method is not wrong, it just a bit messy and not what my users are used to…

    I’m curious looking through the Buddypress code though because there seems to be a function bp_activity_format_notifications which would return a combined string for multiple notifications of the same type (which is exactly what I want) but I can’t actually see where this is used in “standard” Buddypress at all. As the oracle of all things Buddypress, I’d be very grateful if you might be able to suggest how/where this function is actually used as possibly I might be able to make use of it in creating a tidier notifications dropdown.

    Any thoughts would be much appreciated as always.
    Nik

  • Keymaster
    (BuddyDev Team)
    Posts: 24332
    Brajesh Singh on #50707

    Hi Nik,
    My assumption is your theme is making its own formatted notification. BuddyPress by default, has the ability to list grouped as well as individual notifications.

    The formatting of notification for display is controlled by various component(each component manages 1 or more type of notification) you have enabled.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 279
    NikB on #50729

    Hi Brajesh

    Thank you for your thoughts and that makes a lot of sense.

    Whilst I can see that the functionality is there by default, I still can’t figure out if/when that functionality is actually ever used by Buddypress by defautl (ie. exactly where Buddypress actually displays grouped notifications) but maybe it doesn’t?!

    Either way, I do appreciate your input which has helped me to see things a bit more clearly and I think I’ll leave things as they are for now at least.

    Regards
    Nik

  • Keymaster
    (BuddyDev Team)
    Posts: 24332
    Brajesh Singh on #50735

    Hi Nik,
    No issues.

    Have a great day!

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved