Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Creating different custom menu bars for different courses: Creating different menu bars: Difference between revisions

From MoodleDocs
(redirect)
 
(41 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Template:Themes}}This tutorials explains how to create different custom menu bars for different courses in a Moodle site
#redirect [[Creating different custom menu bars for different courses]]
 
This level of technical knowledge is moderate to advanced, as the tutorial involves some previous knowledge of php an css.
 
==What is the 'custom menu' bar==
 
The custom menu bar is the horizontal bar displayed on top of the screen, usually after the Moodle logo:
    [[ File:menu_bar.png|menu bar]]
 
#
#
#
##
I
 
Link to other pages
* [[Themes 2.0 creating your first theme]]
* [[Themes 2.0 overriding a renderer]]
 
==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):
<code php>
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
</code>
 
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==
 
<code php>
class theme_themename_core_renderer extends core_renderer {
 
    protected function render_custom_menu(custom_menu $menu) {
        // Our code will go here shortly
    }
 
}
</code>

Latest revision as of 07:10, 8 August 2013