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

Asked

Viewed 59 times

0

Good afternoon,

My question is this::

I need to change the structure of the home only of the home, instead of leaving 3 columns (navigation, content and aside-right) I will leave only one column that is of the content, I wonder if there is any way I can leave home with this structure and in the other internal pages I maintain the standard 3 column structure.

Another question:

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

I am knowing the Moodle now, already created a Child Theme and I am modifying it, but these modifications above I found more complicated.

Thank you

1 answer

1

View the file config.php of your theme and configures according to your need.

I have a theme that I configured 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 question, you can solve using the file renderers.php, I did something kind of 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;
            }
        }
...
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.