I am trying to design a new theme, that having side-pre region and bottom region. In this bottom region(From left to right) I have to add 4 blocks side by side. Please help me, how to define the region(area, location) and in which files I have to modify.
Hi Amal,
I will assume that you are using the most uptodate version of Moodle 2.9 and have Bootstrapbase as the parent theme.
The basic code to add the block regions is as follows: You would put this in the Page-Footer of the layout file called columns2.php
<footer id="footer-blocks">
<div class="row-fluid">
<?php echo $OUTPUT->blocks('ft-lft', 'span3 desktop-first-column'); ?>
<?php echo $OUTPUT->blocks('ft-mid-lft', 'span3'); ?>
<?php echo $OUTPUT->blocks('ft-mid-rgt', 'span3'); ?>
<?php echo $OUTPUT->blocks('ft-rgt', 'span3 pull-right'); ?>
</div>
</footer>
The Language strings for each block is needed to in theme/yourthemname/lang/en/theme_yourthemename.php
$string['region-ft-lft'] = 'Footer Left';
$string['region-ft-mid-lft'] = 'Footer Mid Left';
$string['region-ft-mid-rgt'] = 'Footer Mid Right';
$string['region-ft-rgt'] = 'Footer Right';
Last but not least you need to list the new block regions in your theme's config.php
For example:
$THEME->layouts = array(
// My dashboard page.
'mydashboard' => array(
'file' => 'columns2.php',
'regions' => array('side-pre', 'ft-lft', 'ft-mid-lft', 'ft-mid-rgt', 'ft-rgt' ),
'defaultregion' => 'ft-lft',
'options' => array('langmenu' => true),
),
);
I hope this helps?
Cheers
Mary