If you use the block settings page to move a block, then in the drop down menu for where to position the blocks are block regions not present on the current page.
For example, when using the classic theme, which has left and right block regions on various pages, but only one of them (side-pre) in the 'incourse' layout used for course activities.
If you go to forum in a course, turn editing on and add a block, the block config page will offer you the option of "right" as a region to put it, but since there is no "right" region, it will put it into the region set as default (left in this case).
It would be better if the block menu only showed you the regions that currently exist on the page.
This is particularly noticeable if you add a custom block region intended only for one particular layout as it will turn up in all of these pages as an option.
Currently this logic is shared between the default region setting and the "on this page" region setting:
$regionoptions = $this->page->theme->get_all_block_regions(); |
foreach ($this->page->blocks->get_regions() as $region) { |
// Make sure to add all custom regions of this particular page too. |
if (!isset($regionoptions[$region])) { |
$regionoptions[$region] = $region;
|
}
|
}
|
|
I think the default region should list all the regions on the site as above, but the "on this page" setting should only offer the block regions available on the current page.
- duplicates
-
MDL-69009 Configuring a block allows a user to set a region that is not used by the page
-
- Closed
-