Removing blocks when using mymobile theme

Re: Removing blocks when using mymobile theme

by Gareth J Barnard -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Alex,

With the MyMobile theme the blocks will not show on a 'mobile' device but on a 'tablet' they will.  I'm not sure how to do 'some' but you can remove all whilst having them on a normal computer display.  To do this, edit the MyMobile 'config.php' and comment out / delete the following:

 

// Get whether to show blocks and use appropriate pagelayout
// this is necessary for block JS errors and other block problems
$thisdevice = get_device_type();
if ($thisdevice == "default" || $thisdevice == "tablet" || optional_param('mymobile_blocks', false, PARAM_BOOL)) {
// These are layouts with blocks
$blocklayouts = array('course', 'incourse', 'frontpage', 'mydashboard', 'mypublic');
foreach ($blocklayouts as $layout) {
$THEME->layouts[$layout]['regions'] = array('myblocks');
$THEME->layouts[$layout]['defaultregion'] = 'myblocks';
}
}

Cheers,

Gareth