Setting a block default weight and position

Setting a block default weight and position

by J D -
Number of replies: 2

Hi Moodler,

Using 2.5.2+, I'm trying to set a default weight and position to a block (for example, badge to the right at -8) so when a teacher add it to his course, it is always displayed at the same position. By reading this (http://docs.moodle.org/25/en/Block_settings):

  • Default weight: Where in the column do you want it to appear if there are other blocks in that column. -10 will put it at the top, 10 will put it at the bottom. A zero is neutral.

I figured that I only have to set the default weight/position in the "Where this blockappears" but no, when I go into other course and the same block, it still appear on the left at weight 3.

I try this with different block type and different theme without any difference.

Can you tell me if it's me that misunderstand the block parameters or if it's a bug?

Thanks.

 

Average of ratings: -
In reply to J D

Re: Setting a block default weight and position

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The default weight applied when you add one 'sticky' block instance at the site level, and set it to appear on every course page.

When you add a separate instance of the block to each course, then it does not work like that, but what you suggest seems like a sensible idea to consider implementing in future.

There is a way to set which blocks are added to each course (in what order) by default when a new course is created. See http://docs.moodle.org/20/en/Block_layout#Default_block_layout_for_new_courses

In reply to Tim Hunt

Re: Setting a block default weight and position

by J D -

Thanks Tim. Yep, I already got that piece of information and actually using it for new courses. However, in the present case, I was not looking for a default block in a new course but a default position for a specific block in an existing courses...Your explanation made it pretty clear however on how to use the block's settings and it answered my question.

Maybe it would be a good idea to review the help text related to the section "Where this block appears" to specify that it is for use with sticky block only?