Is it at all possible to have a different default tab for the activity stream except the “All Members” tab displaying everything?
Hmm… I’d be interested in this as well. Was there a fix that someone had written up a while back?
i’ve tried doing this for the activity page and the profile activity, but I wasn’t able to get it going…i think there was someone who posted a possible solution but I can’t find it.
It almost makes sense to include the logic you described into the default BP. Its the most common activity logic found everywhere else….so you got my vote.
I did some snooping around and found some tips for changing the ordering and defaults tabs of groups, but nothing on the default activity tabs.
http://shabushabu.eu/reordering-buddypress-group-tabs/
I found a thread that @modemlooper made a couple months back discussing the issue. I completely forgot that I had posted on the thread.
Hmm… did some more snooping. The relevant file is /bp-child-default-theme/activity/index.php
Ideally there would be a single function that should generate the current activity tabs, that way we could use the hook to remove the existing function and then drop in our own existing function via add_action();
Unfortunately I see nothing of the sort. Here are lines 18 – 56.
http://pastebin.com/PH8BTyN8
Whoa, whoa, come to think of it then theoretically there should be a single value floating out there somewhere that’s making the “All Members” tab behave as the default.
Wow, I think I just figured out how to do it. It’s kind of hacky but I’ll share it with yall anyway.
1. Make sure that you’re working on a child theme of the BP Default theme.
2. Copy/paste the contents of bp-default/activity/index.php into your child theme’s activity/index.php folder
3. Find the line <li class="selected" id="activity-all">
and delete class="selected"
4. Scroll down a few lines further to <li id="activity-friends">
and insert class="selected"
just after id="activity-friends"
And that should be it. One thing I’ve noticed though is that the browser still seems to remember what the last tab was that you were using. But if you login into your account with a completely new browser then your default activity tab will be “Friends”.
If anyone else has a less “hacky” solution then by all means share with us.
@paulhastings0
So it won’t display anything when you are not logged in?
To be honest I don’t remember. It might just display something like “There are no current topics” or something similar to that or perhaps it’ll just default to the only available tab which would be the “All Members” tab since logged-out users obviously don’t have the “My Friends”, “My Groups”, etc. tabs.
Of course to guarantee what logged-out guests see, someone could write an if/else clause that decides what activity to set as “selected” depending whether they’re logged in or not. For the purposes of our website though we don’t allow logged-out visitor to see our pages at all, so it really wasn’t an issue for us.
@paulhastings0
Hi, I used this method before, and I even moved <li id="activity-all">
to the end of all tabs.
But after this, although it appears the preferred tab(“My friends” or “my groups”) is selected, the actual activities automatically loaded below the tabs are still all members’ activities.
So it seems the class="selected"
is just for defining css style, it does not change the default activity sream loaded.
thank you very much! worked great!