Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,
    I have somewhat the same question, but i want to make Home the default tab since I am using the BP Group Hierarchy Propagate plugin which shows all activity of sub-groups.

    Plugin Author David Dean

    (@ddean)

    Hi guys –

    You’ll need to edit your theme to change the default tab. The file I think you need to modify is groups/single/home.php

    As always, use a child theme when making edits. Please let me know if you have any other questions!

    – David

    Thanks David, but I don’t see what to change in groups/single/home.php
    where you can change the default tab.

    To make it clear, when the group page loads, how do we change the tab that displays content from Members to something else. When a person goes to a group page, I want them to see the content of the Groups tab.

    Thread Starter iheartwine

    (@iheartwine)

    Jeffrey, I have used this code and it works fine. I this case every groups default tab is MEMBERS and for particular i changed to HIERARCHY and it displays sub-groups. You can of course switch to make Hierarchy as a default group.

    add_filter('bp_groups_default_extension','bpdev_custom_group_default_tab');
    
    function bpdev_custom_group_default_tab($default_tab){
    
    $group=groups_get_current_group();
    $default_tab = 'members';
    
    if(empty($group))
    return $default_tab;
    
    switch($group->slug){
    
    case 'your-group-with-subgroups':
     $default_tab='hierarchy';
     break;
    }
    
    return $default_tab;
    }

    Ok, I put this in functions.php and got the result I wanted, Thanks!!

    add_filter('bp_groups_default_extension','bpdev_custom_group_default_tab');
    
    function bpdev_custom_group_default_tab($default_tab){
    
    $group=groups_get_current_group();
    $default_tab = 'hierarchy';
    
    if(empty($group))
    return $default_tab;
    
    switch($group->slug){
    
    case 'your-group-with-subgroups':
     $default_tab='hierarchy';
     break;
    }
    
    return $default_tab;
    }

    Ok I used it in functions.php with success. Thanks!!

    Oops,
    I had to add the case….

    case 'network-groups':
     $default_tab='hierarchy';
     break;
    case 'company-networks':
     $default_tab='hierarchy';
     break;
    }

    Hi, the code provided above did do the trick to make the tab of subgroups appear when clicking on a parent group. But, is there a way to condition the code that when a subgroup is clicked, it opens that group page showing the HOME tab by default? Otherwise, it show by default an empty hierarchy tab.

    I’m very new to php so maybe that’s the “case” code above. If so, how do I know what to call the subgroup? I don’t have anything called “network-groups” or “company-networks”.

    In fact, what I would really like to do is have the bottom level subgroups open with the default tab set to groupblog.

    please help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Subgroups as a default group tab’ is closed to new replies.