Creating Submenus in moodle

Creating Submenus in moodle

by Sayali Kulkarni -
Number of replies: 4
Hello,

Can we create submenus in Moodle?
If yes can someone help me out with how to create them?
Average of ratings: -
In reply to Sayali Kulkarni

Re: Creating Submenus in moodle

by Barry Oosthuizen -
Hi,

sure you can, what kind of submenus did you have in mind and where do you want to use them? You'd have to do it programmatically though.

If you want tabs with subtabs there are pages in moodle (e.g. the profile page, database activity) that use subtabs. You could look at the code for those pages to see how it works.

For a horizontal menu system like the one you see here on moodle.org you could have a look in the themes database

Cheers,

Barry
In reply to Barry Oosthuizen

Re: Creating Submenus in moodle

by Ravishankar Somasundaram -
If you are looking to put some sub menus in the Site Administration block or something ?

look into ./lib/adminlib.php function called admin_settingpage() and its usage in other pages.

But as barry said you need to code it.

In reply to Barry Oosthuizen

Re: Creating Submenus in moodle

by Sayali Kulkarni -
Yeah i'm looking for creation of sub menus in the themes database..
theres a moodle theme which already has a menu bar... i just want to add sub menus to it..

can that be done?
and how?

In reply to Sayali Kulkarni

Re: Creating Submenus in moodle

by Barry Oosthuizen -
Hi Sayali,

So which theme are you using?

If you use the Aardvark theme you can simply edit the topmenu.php file to add your own menus/submenus.

This link gives you an idea (with downloadable code) of how to implement a CSS based horizontal menu with (nested) submenus.

I implemented this in 'Beaux theme with nested menus (automatic)' but mine is an automatic course category & course menu system (based on a mix of the lwis.net, Aardvark & A theme with automatic Menus bar). Of course it can still handle manually added menu items as well by editing the topmenu.php file.

Hope this helps.

Cheers,

Barry