Changing set_pagelayout from Theme

Re: Changing set_pagelayout from Theme

by Mary Evans -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I think I have it! At least it worked in the page I wanted it to.

Since I do not know what theme you are using as this will also need some adjusting.

But using Moodle 3.3 Clean theme with this small change to the columns2.php layout

this will change the position of a side-pre (left) to display on the (right)

Changes are needed in the following places:

  1. theme/clean/layout/columns2.php (make copy and rename to standard.php)
  2. theme/clean/config.php
Please add the following conditional code to the standard.php just
below the section as seen here below!
1.)
// Get the HTML for the settings bits.
$html = theme_clean_get_html_for_settings($OUTPUT, $PAGE);

global $CFG, $SITE;
if ($this->page->pagetype == 'message-index') {
    // Special case for message page - please do not remove.
    $regionmain = 'span9 desktop-first-column';
    $sidepre = 'span3 pull-right';
} else {
    $regionmain = 'span9 pull-right';
    $sidepre = 'span3 desktop-first-column';
}
Please add to the theme/clean/config.php
2.)

$THEME->layouts = array(
    // Standard layout customised layout.
    'standard' => array(
        'file' => 'standard.php',
        'regions' => array('side-pre'),
        'defaultregion' => 'side-pre',
    ),
);

Hope this helps?

Mary

Average of ratings: Useful (1)