theme side-pre and side-post regions

theme side-pre and side-post regions

by Simon Lewis -
Number of replies: 3

Hi,

I'm re-designing a boost based theme and I've just got a question about moodle good practice really.

Boost only uses side-pre region and puts them in the right, but side-pre seems to have historically been on the left. Side-post is a core region but not used in boost, but it is in other themes, and seems to historically be on the right. Also the name side-pre would suggest left, before the main main-content and side-post on the right. 

Why is side-pre used to put everything on the right instead of side-post? Are moodle phasing out side-post or something? 

I just want to understand the thought process, so I don't end up changing it all again in a year or 2.


thanks,

Simon

Average of ratings: -
In reply to Simon Lewis

Re: theme side-pre and side-post regions

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Simon,

There was a massive bun fight about this many moons ago on if 'side-pre' is 'left' and 'side-post' is 'right' and in relation to RTL vs LTR languages. My view is that 'pre' sort of means 'first' and 'post' means 'second', so think of as 'primary' and 'secondary' regions.

Also 'side-post' is not a core region, nor is 'side-pre'. The regions are defined at the theme level, so you can have anything you want, even 'side-statler' and 'side-waldorf' if you want.

G
In reply to Gareth J Barnard

Re: theme side-pre and side-post regions

by Simon Lewis -
Yes, primary and secondary makes more sense.
The reason I thought of it as core, was because you can set them as default regions in the config. But I couldn't see a way of setting default blocks in any new theme created regions.
$CFG->defaultblocks_override = 'block1:block2';
Which puts them in the regions of - side-pre:side-post, and refers back to lib\blocklib.php

Anyway, just thought I'd check in case I missing something major.
thanks,
Simon
In reply to Simon Lewis

Re: theme side-pre and side-post regions

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Simon,

Oh, interesting! I was not aware of that code, humm! Looking at the definition for the block pos left / right in blocklib.php then it says 'Default names for the block regions in the standard theme.' and now the Standard theme does not exist. Perhaps its time for an overhaul of this.

Looking at the related code, then there is no way you can currently specify other regions with this functionality. However, there is nothing stopping you writing your own CFG attribute instead.

G