What hook can I use to filter the topics that appear when accessing /groups/mygroupname ?

NodeBB Development
  • I'm having trouble finding the best server-side hook to use so I can filter the topics that show for the users (members) who are part of the group. The route is (/groups/<mygroupname>)

    I was starting to look at the different hooks but I was having trouble finding the one that is best suited for the topics that display from the members when accessing this /groups/<mygroupname>

    The reason I ask:
    Currently the default functionality for the groups/<mygroupname> is showing all of the posts that a member made thru out the nodebb categories. I need to filter it to only show the posts the members made for the group they are currently viewing. I was able to accomplish this with some clientside code. However, it is ugly hack because I am removing the already rendered posts that do not belong to the group that the user is viewing. I need to filter this out most likely server-side to get the best user experience.

    I tried a few different hooks but I can't seem to find the best one to get this done. I am trying to avoid messing with the nodebb core since I am writing a plugin and wish to just make my adjustments without touching the base.

    Basically I have currently a matching category that links to an associated group. I only want the topics posted from that specific group to show inside the group. Just looking for suggestions on best place to filter.

    Thanks for any advice.

  • Group details page doesn't have any hooks right now, but for all pages, you can use the associated "build" hook.

    For this page, I believe it'd be filter:groups/details.build

  • @julian said in What hook can I use to filter the topics that appear when accessing /groups/mygroupname ?:

    filter:groups/details.build

    Hi Julian,

    Thank you for this info. My issue is now solved. I was able to perform my serverside filter logic and now everything is great.

    FYI - I'm the same guy (username: jremi) that you helped related to the sharing sessions plugin. I was asking you about if using the cross storage solution would work for cross domain cookies.

    Thanks again for your help. I really appreciate your assistance.


Suggested Topics


  • Can't using sso login

    NodeBB Development
    0 Votes
    1 Posts
    144 Views
  • 0 Votes
    1 Posts
    664 Views
  • support "zeit/pkg"?

    NodeBB Development
    0 Votes
    2 Posts
    1261 Views
  • 0 Votes
    4 Posts
    2304 Views
  • 0 Votes
    15 Posts
    10148 Views