Main Menu Block

Re: Main Menu Block

by John Papaioannou -
Number of replies: 0
This applies to 1.5 development and any newer versions:

If you want to display the site main menu in other courses, you can open blocks/site_main_menu/block_site_main_menu.php, find:

function applicable_formats() {
return array('site' => true);
}
replace with:
function applicable_formats() {
return array('all' => true);
}
Also, search for all instances of "$this->instance->pageid" and replace with "SITEID". Now you can have the block in all courses.

However, this is a hack and adding things to the menu from any page other than the site index will not be possible. And a good thing too, because the same information would appear in all courses.

Basically it's a matter of the "site" course having some special properties that other courses don't have.

Your other option would be to use the "HTML" block that will come with 1.5, which allows the teacher to put anything he wants into the block by using the HTML editor to edit its contents.

Your original wish of having a piece of "standard" content to which the teacher can add things is not currently possible, although it can be done if you spawn a modified version of the HTML block. Since this feature sounds useful indeed, you might want to open a new feature request in the bug tracker.

Cheers!
Jon