Move "Add a Block" to the right side.

Move "Add a Block" to the right side.

by Steve Ambro v3.8 -
Number of replies: 6

(Magazine theme)

I find that the "Add a Block" option takes up too much real estate in the left side of the screen pushing columns off the screen on the right side.  I change the size of the window and the "Add a block" expands and takes up more room.  This makes me then have to go in and hide columns such as E-mail in order to have a useful screen.

It totally makes sense to me that the Add A Block option should be moved to the right side along with the Search Forums, Latest News, and Recent Activity options.

Before I go any further, am I doing something wrong?  Is there some switch I can use to cure this problem?  Is this in the set up that I might refer to the Moodle Maven to address?

Since I know enough about HTML and CSS to be dangerous, I am willing to look into PHP (along with some colleagues that know PHP) to make this work.  I might also like to fix the bottom horizontal scroll bar problem.

Thoughts appreciated

 

Attachment Moodle Fix 3b.png
Average of ratings: -
In reply to Steve Ambro v3.8

Re: Move "Add a Block" to the right side.

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

Hi Steve,

The 'Add a block' is a 'fake block'.  The side it gets added to is currently determined by the first entry in the 'regions' array in the theme 'config.php' file for the layout of the screen you are on, so for example if you want it to be 'side-pre' have:

'regions' => array('side-pre', 'side-post'),

if you want it to be 'side-post' then have:

'regions' => array('side-post', 'side-pre'),

Off the top of my head I cannot remember the tracker issue where this has been discussed.  There were at some point in time plans to use the 'defaultregion' - I'm not sure if this has already happened.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Move "Add a Block" to the right side.

by Mary Evans -

Gareth,

What you are saying here is not strictly true as the default region dictates which side the default-region is and where the ADD BLOCK sits.

True the order of side-pre / side-post can be changed and this has some bearing as to which side take presidence, but this does not define the 'defaultregion', that is defined in the theme's config.php...unless something new is on the way in which case that is news to me! sad

Or are you talking about the use of default regions for fake blocks which I set in the book mod recently? MDL-41595

PLEASE NOTE:

OOOPS SORRY it looks like I will have to retract my comment above after having read the conversation with Tim. in MDL-41595 smile LOL

Cheers

Mary

In reply to Mary Evans

Re: Move "Add a Block" to the right side.

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

Hi Mary,

I am indeed referring to MDL-41595 with the difference:

 // Arrange for the navigation to be displayed in the first region on the page.
 $navbc = $attemptobj->get_navigation_panel($output, 'quiz_attempt_nav_panel', $page);
-$regions = $PAGE->blocks->get_regions();
-$PAGE->blocks->add_fake_block($navbc, reset($regions));
+$PAGE->blocks->add_fake_block($navbc, $PAGE->blocks->get_default_region());

I just thought that most places used:

$PAGE->blocks->add_fake_block($navbc, reset($regions));

And that is where the 'Add a block' block was added. Not the actual blocks that are added, they do indeed should end up in the 'defaultregion'.

Cheers,

Gareth

In reply to Steve Ambro v3.8

Re: Move "Add a Block" to the right side.

by Mary Evans -

Hi,

The default region used to be the right side (side-post) but we found that when editing was enabled the ADD BLOCK (block) got in the way when editing a page, as it made the area smaller to work with especially when using the HTML Editor.

We are trying to get the Add Block moved out of the main content area of the page, but this is low priority, so it is left up to the administrator to change the location of the default block in the config.php of the theme they are using.

So an incourse page setting in the magazine/config.php looks like this...so by changing side-pre to read 'side-post' will solve the problem for you

    'incourse' => array(
        'file' => 'general.php',
        'regions' => array('side-pre', 'side-post'),
        'defaultregion' => 'side-pre',

        'defaultregion' => 'side-post',
    ),

Hope this helps?

Mary

In reply to Mary Evans

Re: Move "Add a Block" to the right side.

by Steve Ambro v3.8 -

OK, this is going to take some thinking as this is mostly Greek to me.  I will have my own Moodle as a test bed and will be checking all this on my own.  I figure that I could also gather directions edited from these replies and send them to the team working the Moodle Master.

On a second note, Is it possible to dedicate the width of the Add A Block to a specific size rather than having it enlarge as the screen is changed?

The discussion seemed to allude that the left side was chosen for the "Add A Block" block.  What was the reason for his.  Might I be missing something that would warrant a left side block and leaving it alone?

In reply to Steve Ambro v3.8

Re: Move "Add a Block" to the right side.

by Mary Evans -

The main reason the ADD BLOCK was moved to the left side was to prevent the ADD BLOCK appearing on the right when editing is ON as it more often than not caused problems.

The easiest way round this is make the defaultregion side-post where there is a side-post region available.

See attatched THEMES_LAYOUT.txt for guidance.

If you need more help please ask.

Cheers

Mary