Moodle - Change home structure according to user and keep different in relation to other pages

0

Good afternoon,

My question is this:

I need to change the structure of home only from home, instead of leaving 3 columns (navigation, content and aside-right) I will leave only one column that is of the content, I would like to know if I have to leave ON the home with this structure and the other internal pages I maintain the default structure of 3 columns.

Another question:

I need to create two homes, in the structure mentioned above, but each home will display a different content according to the user login, eg: ADMIN will have access to a home and Educator will have access to another home, is it possible? Any ideas on how to do it?

I'm learning moodle now, I've created a child theme and I'm modifying it, but these changes I found to be more complicated.

Thank you

    
asked by anonymous 12.02.2016 / 18:59

1 answer

2

View the file config.php of your theme and configure it as you need it.

I have theme that I set up as follows:

// The site home page.
    'frontpage' => array(
        'file' => 'frontpage.php',
        'regions' => array('side-post', 'middle'),
        'defaultregion' => 'side-post',
        'options' => array('nonavbar' => true),
    ),

// My dashboard page.
    'mydashboard' => array(
        'file' => 'columns2.php',
        'regions' => array('side-post'),
        'defaultregion' => 'side-post',
        'options' => array('langmenu' => true),
    ),

// Server administration scripts.
    'admin' => array(
        'file' => 'columns2.php',
        'regions' => array('side-post'),
        'defaultregion' => 'side-post',
    ),

This way you can configure your home page.

Regarding the second doubt, you can solve using the file renderers.php , I did something like this in my theme:

protected function render_user_menu(custom_menu $menu) {
        global $CFG, $USER, $DB, $OUTPUT;

        $addlangmenu = true;
        $addmessagemenu = true;

        if (!isloggedin() || isguestuser()) {
            $addmessagemenu = false;
        }
        if (!$CFG->messaging) {
            $addmessagemenu = false;
        } else {
            // Check whether or not the "popup" message output is enabled
            // This is after we check if messaging is enabled to possibly save a DB query.
            $popup = $DB->get_record('message_processors', array('name' => 'popup'));
            if (!$popup) {
                $addmessagemenu = false;
            }
        }
...
}
    
03.05.2016 / 19:29