Change the default home page

Hi !

i needs to change the default index for when typing the root url of the elgg website, be send directly on the riverdashboard (my riverdashboard already replace the normal dashbord).

First i did that in my start.php og my theme :

function theme_shareme_init() {

    // Replace the default index page

if (isloggedin())

{

    register_plugin_hook('index','system','new_index');

}

}

function new_index() {

    if (!include_once(dirname(dirname(__FILE__))) . "pg/riverdashboard/")

        return false;

     return true;

}

register_elgg_event_handler('init','system','theme_shareme_init');

 

This work perfectly on my local server (wamp) but not on my online server.... any idea of this problem ?

Than i was thinking use the following field in site administration :
Enter the view which will be used as the default for your site or leave this blank for the default view (if in doubt, leave as default): 
who is set as "default", i put pg/riverdashboard/ but my site don't work anymore i have white page everywhere !  i found nowhere documentation about how use this field, can someone explain me please ?

Thanks in advance.

  • That view field in site administration is for view type (e.g. default (computer) mobile (phone) etc.) Set it back to default.

    Elgg standard defaults to dashboard after login but if yours isn't doing this you can dowload the Login Redirector plugin to solve your problem.

  • the problem is my website is for exemple like that :

    http://www.my-domain.com/site/

    Then when i login it's ok im well redirect on dashboard here http://www.my-domain.com/site/pg/dashboard/ , but if i leave the page without logout ou if i take off pg/dashboard/ in my browser url field and press enter, the redirection is not ok anymore. But on my local server it's ok... that the strange part !

  • If you take the pg/dashboard/ off, where does it take you?

  • I see, it seems to be working the way it should in standard elgg.

    I'm sure you could do something simple such as 

    if is loggedin forward to pg/dashboard/

  • yes but it's what i don't understand, on the elgg index.php there already 

    if (isloggedin()) {

    forward('pg/dashboard/');

    }

    and on my theme start.php page i put that too :

    <?php

     

    function my_theme_init() {

        // Extend system CSS with our own styles

        extend_view('css','riverdashboard/css');

        // Replace the default index page

        register_plugin_hook('index','system','new_index');

    }

     

    function new_index() {

        if (!include_once(dirname(dirname(__FILE__))) . "pg/riverdashboard/index.php")

            return false;

     

     

        return true;

    }

     

    // register for the init, system event when our plugin start.php is loaded

    register_elgg_event_handler('init','system','my_theme_init');

    ?>

    on my local wamp server it's ok but not online, tested on 2 different online servers, i don't understand !

  • ok it's one of the plugin who do that, because if i disable all and enable only my theme it's ok ! i have to try enable one by one for find the guilty ! and after that find how to correct !

    Anyway thank you very much for your help !

  • And the winner is walledgarden :D