Skip to:

Group Tree Filtering

  • I’m using WP 3.1.4, BP 1.2.8 and BP GH 1.2.3.

    I have a parent group that I allow subgroups to be created within it and that works and displays fine. What I would like to know is if it is possible to filter the main Groups directory to display only those groups that contain subgroups when clicking on the group tree link. Currently, all parent groups display and those that have subgroups have the + indicator while those that have no subgroups have the – indicator. I would like to have returned only groups with the + indicator.

    Also, Is it possible to display the Member Groups tab for only one specific parent group? The parent group described above I use as a master group for containing educational classes (which are subgroups). All other parent groups are only for discussion and will never contain any subgroups. How can I show the Member Groups tab for just one parent group?

    Thanks for the help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Your first question – about filtering the group tree display – is possible by editing the files in the “templates” folder. You shouldn’t actually edit those, as they’ll get overwritten by updates, but instead copy them to your theme folder and work with them there. You should be able to see what controls whether a “+” or a “-” is displayed and use that logic to filter the display.

    There isn’t a way to filter the groups result set by whether a group has children, but that should tide you over.

    As for your second question, the Member Groups tab isn’t supposed to show up on a group’s page for users who can’t create subgroups unless it already has subgroups.



    @ddean , can we have one member group list for each top-level(or parent) group? for example, I want to add a front page for each parent group, this parent group’s front page will show a list of member groups list.

    @imjscn – that sounds like the `Member Groups` tab to me. Are you looking for something different, or just for it to be moved to the first tab / front page?



    @ddean, sorry for my question not clear.
    I said “front page”, it’s just for highlight that it’s on a page that out of a single group.
    yes, it’s the Member Group Tab. But I want to use it out of a single group nav so that I can freely use the parent’s name as a category, and use the child list anywhere else.

    @imjscn you could use the `bp_has_groups_hierarchy` function (works just like `bp_has_groups`) with an argument key of `parent_id`, it’ll fill the groups “loop” with children of the group you passed. You can then use the groups-loop.php template file to show all the child groups.

    Take a look at the `display` function in the extension.php for an example of how this is done, and let me know if you have any other questions! :)



    @ddean , thanks for showing the way, much appreciated!
    I sure have another question :-)
    This time I want to do it inside a single top-level group.–
    Is it posible to have all children’s Forum Topics listed and sortable on one tab ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Group Tree Filtering’ is closed to new replies.
Skip to toolbar