Course List Dropdown Menu

Course List Dropdown Menu

by Patrick Malley -
Number of replies: 7
I spent some time last night trying to get a course list to appear in the header of my theme.

Here's what I found:

<?php print_whole_category_list() ?>

will print the category list with courses, albeit in a table, which unfortunately is useless to me.

<?php print_course() ?>

will print the coursebox with nothing in it(?)

<?php print_courses() ?>

will print all course (your currently enrolled in, perhaps?), but it unfortunately also shows the teacher name and course summary.

HERE'S WHAT I NEED:


I need a print function to generate all categories and courses (preferably in a nested unordered list)

The output would be something like this:

<ul>

  <li>Category 1</li>

    <ul>

      <li>Course 1</li>

      <li>Course 2</li>

      <li>Course 3</li>

    </ul>

  <li>Category 2</li>

    <ul>

      <li>Course 4</li>

      <li>Course 5</li>

    </ul>

</ul>



If possible, it would be nice if a function could be created in lib.php to produce this type of list.

If that is not possible, can someone please help me create such a function myself.

Thank you so much as this is an frequent request of my clients and would make the use of dropdown menus much better.


Average of ratings: -
In reply to Patrick Malley

Re: Course List Dropdown Menu

by Rob Rashotte -

Have you checked out the "accordion course menu" plugin?

You can find some discussions about it if you search the forums. I am using it and it works well. Fairly easy to customize as well.

Rob

In reply to Rob Rashotte

Re: Course List Dropdown Menu

by Patrick Malley -
Thanks Rob,

But this isn't what I'm looking for.

I'm a theme designer and am in need of a specific hook that I can include in a theme header.html that will pull the course categories and courses in a nested list.
In reply to Patrick Malley

Re: Course List Dropdown Menu

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
If you don't have any luck doing it yourself based on the resources others have provided here, you might like to consider contracting somebody else to develop it for you. For instance, you could try your local Moodle Partners; they might be willing/able to do small development jobs like this.

--sam
In reply to sam marshall

Re: Course List Dropdown Menu

by Patrick Malley -
Thank you, Sam.

I am fully aware that there are plenty of people out there to hire to get the work done. smile That's not my point.

As a theme designer, I'm more interested in getting the most out of what Moodle can currently offer, and suggesting improvements when I think they're needed to improve the look and feel of the theme. The purpose of my post was simply to see if there was something I was perhaps missing.

If I'm correct, and there is not currently a method for calling these variables, then there should be, although not necessarily in the format I've suggested.

This may be part of what Urs has been suggesting in templates?
In reply to Patrick Malley

Re: Course List Dropdown Menu

by Patrick Malley -
Nevermind.

I've found a solution:

http://moodle.org/mod/data/view.php?d=26&rid=2029
In reply to Patrick Malley

Re: Course List Dropdown Menu

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

This link is not working anymore!

I get this error a lot lately 'item needs to be approved'. Why is this?