Extending custom Menu to display all courses

Extending custom Menu to display all courses

by Mark Andrews -
Number of replies: 3

Hi all,

I would like to make better use of the custom menu component by getting it to display all the sites courses, in much the same manner as the navigation block does on the homepage.

I've worked my way through the excellent tutorial on extending the custom menu: http://docs.moodle.org/en/Development:Themes_2.0_extending_the_custom_menu

And have got it to display courses i'm enrolled in but would now like it to display all courses using category headings and sub menus.

I'm sure I would only need to tweak the above code but can't seem to find the right object to pass and help here would be fantastic!

Thanks in advance for any help

regards

Mark

 

Average of ratings: -
In reply to Mark Andrews

Re: Extending custom Menu to display all courses

by Mary Evans -

I Mark,

You may find this discussion useful...

http://moodle.org/mod/forum/discuss.php?d=149803#p689994

It's related to the custom menu discussion which was started by Sam Hemalryk

I successfully integrated a customised menu in Moodle 1.9 last year which added Menu items dynamically using Catagories and Courses. The theme was called Transient but I had to withdraw it becasue of the Creative Commons license issue. If you visit my site to view this theme, there is only one menu item there, but it has various links off it. So if you click on Creative Writing the dropdown menu opens up and give 4 links the bottom one is Poetry. If you click on this quite a number of sub-menu items come off it.

I can send you a copy of this theme if you send me your email in a private message. Then you can study all the relevant code.

HTH

Mary

In reply to Mary Evans

Re: Extending custom Menu to display all courses

by Trem_r Trem_r -

Hi,

I'm also very intersted to find an easy answer to Mark's problem, the thread you linked is way to difficult and cryptic for me, I'm surprised that you need such a load of code for such a simple task as retrieving the title and url of categories and courses, and getting them in a html list.

I'm new at Moodle but I'm used to work with others CMS, and I'm used to have an easy access to my content via simple methods, that I can't find nowhere in the Moodle Documentation, I tried to work from the "My courses" dynamic menu to get an "All Courses by categories" dynamic menu, via changing the call "get('mycourses')" by ... anything I could find, but nothing seems to work.

Is there a get('categories') or a get('courses') ? There's nothing in the online documentation, and the navigationlib.php wich I used to refer to find something wasn't of any help.

Like I said, I'm new at Moodle dev, and I thought it would be easy to make a simple menu like I always did in Wordpress Themes and such CMSs, would you have an idea or even a guide to get categories and courses ?

I'm actually thinking that it would be easyer to add it manually in the custom menu everytime a new course is published on my site ...