Customizing the River Dashboard

Hello!  Loving Elgg but have a few newbie questions.

I want to customize the River when it is used as the default dashboard.  Specifically, I want to replace the left hand column with new items.

When I look at the source code for the page of the site, it looks straightforward to edit however I cannot find the corresponding files(s) on the server.

I have spent several hours looking in what looks like the right places (i.e. the directories named after the River and then working up-folder from there, etc.) but am unable to find the file that lays out this page.

Many thanks for any help!

  • ;-) I've done exactly that for a client some weeks ago.. I'll look up the R/D files needed to change the left column. If I don't wake up enough next few hours.. mssg me to remind ;-)

  • Thanks Dhrup - made my day and made me smile large! :-)

    I will poke you later to wake you up - cheers!

  • This a trimmed template version from what my client paid for. Of course I have removed all of their proprietary content.

    @area1 is the basic LHS and $body is the RHS. Have a read thru this and also you might want to compare to the original index.php so that you can see how the code was changed..

    mod/riverdashboard/index.php

    <?php
            require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
            gatekeeper();
            $content = get_input('content','');
            $content = explode(',',$content);
            $type = $content[0];
            $subtype = $content[1];
            $orient = get_input('display');
            $callback = get_input('callback');
            if ($type == 'all') {
                $type = '';
                $subtype = '';
            }
            $area1 = "";
            $body = '';
            if (empty($callback))
            {
    //------------------------------------------------------------------
                                                                     // text 1 @ left hand side
    $text1=<<<EOD
    <div class="sidebarBox">
    <h3>TEXT 1</h3>
    <div class="membersWrapper"><br />
    "<div style='height:200px;overflow:auto;padding:1px; ' >
    <small>
    $txt
    </small>
    </div>
    </div>
    </div>

    EOD;
    //------------------------------------------------------------------
                                                                     // text 2 @ left hand side
    $text2=<<<EOD
    <div class="sidebarBox">
    <h3>TEXT 2</h3>
    <div class="membersWrapper"><br />
    "<div style='height:200px;overflow:auto;padding:1px; ' >
    <small>
    $txt
    </small>
    </div>
    </div>
    </div>

    EOD;
    //------------------------------------------------------------------CONTENT @ left hand side
                //set a view to display newest members
                $area1.= $text1 . $text2;
                //set a view to display a welcome message
                //$body .= elgg_view("riverdashboard/welcome");
    //--------------------------------------------------------------THEWIRE, WELCOME @ main body right hand side
                $body .= elgg_view("activity/thewire")
                        ."</div><div id='two_column_left_sidebar_maincontent_boxes'>"               
                        .elgg_view("riverdashboard/welcome");
                //set a view to display a site wide message
                $body .= elgg_view("riverdashboard/sitemessage");
            } // if (empty($callback))
            switch($orient)
            {
                case 'mine':
                                $subject_guid = $_SESSION['user']->guid;
                                $relationship_type = '';
                                break;
                case 'friends':    $subject_guid = $_SESSION['user']->guid;
                                $relationship_type = 'friend';
                                break;
                default:        $subject_guid = 0;
                                $relationship_type = '';
                                break;
            }
            $river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '') . "</div>";
            // Replacing callback calls in the nav with something meaningless
            $river = str_replace('callback=true','replaced=88,334',$river);
            $nav = elgg_view('riverdashboard/nav',array(
                                                                'type' => $type,
                                                                'subtype' => $subtype,
                                                                'orient' => $orient
                                                            ));
            if (empty($callback))
            {
                $body .= elgg_view('riverdashboard/container', array('body' => $nav . $river . elgg_view('riverdashboard/js')));
                page_draw(elgg_echo('dashboard'),elgg_view_layout('sidebar_boxes',$area1,$body));
            }
            else
            {
                echo $nav . $river . elgg_view('riverdashboard/js');
            }
    ?>

  • Awesome - many thanks Dhrup - you rock!

  • hehehe - someone needs a happy pill!  ;-)

  • You know what I'd love?

    Two widget spaces on the left hand side of the riverdashboard, which users can populate with, say, an RSS feed reader or recent visits to their profile (auto-updating, of course). For -my- site, what would be even better would be a minified version of an IRC client, with access to just one room...

    Would be a tight squeeze though.

    *thinks about ways to do this*

  • Funny that you ask ;-) My client had 2, 3 blocks of "dynamic" content - areas which they wanted pulled in from special Admin pages which they could change anytime, e.g. "Help" page summarized *and.. *and an RSS Feed from their sister site !! but I coded a curl piece of code to fetch their RSS's original html page because their RSS feed had junk errors with dates of posts ;-(

    Your IRC Client should simply need to be stuck into the $text in the code.. but I think you'll need the JS/Ajax needed to make it work interactively (obvious;-)

  • Can some tell me how to use the riverdashboard for RSS feed