How to remove All tab from activity page

Can someone give a quick fix to remove the all tab from the activity page.I am using version 1.8.0.1

  •   
    PlugIn ? Not Yet ;-(
    Wait for some kind Developer to code this feature ;-) 

  • i'll see what it will take Private_River working for 1.8 

     

  • @Steve The views has changed a little bit in elgg 1.8, for instance, part of the code of the nav.php is in root/pages/river

    The part of the code that's there is the one that let you choose which tab is going to be the default one.

    If I were to find the correct view where the tabs are being generated I could extend the view. Probably, I don't know lol

  • @steve :Thnanks Steve your help would be really appriciated

    yeah I too browsed through several files of river but was not able to figure out where the view is being generated. :P

  • I figured out how to do it but it seems the file I need to edit to get it done is engine/lib/river.php and I can seem to override that file.

  • Haven't really studied the code, but my first guess would be to try and unregister the menu item.

    if (elgg_get_context() == 'activity') {

    elgg_unregister_menu_item('filter', 'all');

    }

    I conclude this based on the html code:

    <ul class="elgg-menu elgg-menu-filter elgg-menu-hz elgg-menu-filter-default"><!-- developers:begin navigation/menu/elements/item --><li class="elgg-menu-item-all elgg-state-selected"><a href="http://localhost/hypetest18/activity/all" title="" confirm="">All</a></li><!-- developers:end navigation/menu/elements/item --><!-- developers:begin navigation/menu/elements/item --><li class="elgg-menu-item-mine"><a href="http://localhost/hypetest18/activity/owner/ismayil.khayredinov" title="" confirm="">Mine</a></li><!-- developers:end navigation/menu/elements/item --><!-- developers:begin navigation/menu/elements/item --><li class="elgg-menu-item-friend"><a href="http://localhost/hypetest18/activity/friends/ismayil.khayredinov" title="" confirm="">Friends</a></li><!-- developers:end navigation/menu/elements/item --></ul>

    ul.elgg-menu-filter

    li.elgg-menu-item-all

  • @Ismayil Khayredinov Great piece of code! I have that same from html code, I will study the code next week I think, I am tied up with a lot of stuffs I need to do hehe

  • Change root/pages/river.php to this:

    <?php
    /**
     * Main activity stream list page
     */

    $options = array();

    $page_type = preg_replace('[\W]', '', get_input('page_type', 'friends'));
    $type = preg_replace('[\W]', '', get_input('type', 'friends'));
    $active_section =
    $subtype = preg_replace('[\W]', '', get_input('subtype', ''));
    if ($subtype) {
        $selector = "type=$type&subtype=$subtype";
    } else {
        $selector = "type=$type";
    }

    if ($type != 'friends') {
        $options['type'] = $type;
        if ($subtype) {
            $options['subtype'] = $subtype;
        }
    }

    switch ($page_type) {
        case 'mine':
            $title = elgg_echo('river:mine');
            $page_filter = 'mine';
            $options['subject_guid'] = elgg_get_logged_in_user_guid();
            break;
        case 'friends':
            $title = elgg_echo('river:friends');
            $page_filter = 'friends';
            $options['relationship_guid'] = elgg_get_logged_in_user_guid();
            $options['relationship'] = 'friend';
            break;
        default:
            $title = elgg_echo('river:friends');
            $page_filter = 'friends';
                    $options['relationship_guid'] = elgg_get_logged_in_user_guid();
            $options['relationship'] = 'friend';
            break;
    }

    $activity = elgg_list_river($options);

    $content = elgg_view('core/river/filter', array('selector' => $selector));

    $sidebar = elgg_view('core/river/sidebar');

    $params = array(
        'content' =>  $content . $activity,
        'sidebar' => $sidebar,
        'filter_context' => $page_filter,
        'class' => 'elgg-river-layout',
    );

    $body = elgg_view_layout('content', $params);

    echo elgg_view_page($title, $body);
    After changing this the default would be changed to friends and the all tab would still be there but if someone was to click on it it would redirect to friends. I still doint know how to remove the All Tab button though. This file would only make it unaccessable
  • @ib Right, like I said, I can do that, it is overriding the core instead of editing the core I am trying to do.

    @Ismayil Thanks I will work on that

  • Ibrahim Hasan Actually that is not going to accomplish our goal here. Overriding core files is not recommended. That is a bad trick, 'cause actually what I want to code is only to show two tabs, not three.

    @Steve Keep us updated! Let's do this! haha

Feedback and Planning

Feedback and Planning

Discussions about the past, present, and future of Elgg and this community site.