There is a way to get a custom menu in your theme if you have access to the theme files.
I haven't looked at Nimble myself to see what there is, but if it doesn't already have something similar you might be looking at changes in the theme's:
In config.php you need to have the line:
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
And in renderers.php
<?php class theme_nimble_core_renderer extends core_renderer {
// --- Start of custom menu modifications --- // protected function render_custom_menu(custom_menu $menu) {
// Adds the "My Courses" drop down to the custom menu if user is // logged in AND enrolled in some courses.
$mycourses = $this->page->navigation->get('mycourses'); if (isloggedin() && $mycourses && $mycourses->has_children()) { $branchlabel = get_string('mycourses'); $branchurl = new moodle_url('/course/index.php'); $branchtitle = $branchlabel; $branchsort = 9999; $branch = $menu->add($branchlabel, $branchurl, $branchtitle, $branchsort); foreach ($mycourses->children as $coursenode) { $branch->add($coursenode->get_content(), $coursenode->action, $coursenode->get_title()); } }
// Finishes the custom menu.
return parent::render_custom_menu($menu); }
// --- End of custom menu modifications --- //
}
|
For more detailed instructions on overriding renderers in a theme, see this tutorial.