Creating different custom menu bars for different courses: Creating different menu bars
This tutorials explains how to create different custom menu bars for different courses in a Moodle site
This level of technical knowledge is moderate to advanced, as the tutorial involves some previous knowledge of php an css.
The custom menu bar is the horizontal bar displayed on top of the screen, usually after the Moodle logo:
The name 'custom menu' bar comes from the fact that, in Moodle 2.0, the links displayed on that bar can be easily configured by the administrator of a Moodle site through the menu:
Appearance->Themes-> Theme settings and then, configuring the 'Custom menu items' field.
I
Link to other pages
Getting started
Previous readings
- theme/themename/lib.php
- theme/themename/renderers.php
- theme/themename/lang/en/themename.php
Next step open up your themes config.php file and add the following configuration option to it (at the bottom):
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
If you've already got a custom renderer you will already have this line.
And thats it! now we move on to extending the custom menu.
More titles
class theme_themename_core_renderer extends core_renderer {
protected function render_custom_menu(custom_menu $menu) {
// Our code will go here shortly
}
}