Adding all categories and courses to the custom menu

Adding all categories and courses to the custom menu

by Sam Hemelryk -
Number of replies: 5
Hi guys,

Just a quick heads up, I've noticed that the question about adding all categories + courses to the custom menu seems to be coming up over and over again, as such I have written a quick tutorial on one way of achieving this:

Development:Themes 2.0 adding courses and categories to the custom menu

Cheers
Sam
Average of ratings: Useful (3)
In reply to Sam Hemelryk

Re: Adding all categories and courses to the custom menu

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Hi Sam

Wonderful tutorial! thank you very much for the work you put in smile

Richard

In reply to Sam Hemelryk

Re: Adding all categories and courses to the custom menu

by Trem_r Trem_r -

Hi,

I can't thank you enough for this, it's working fine, and I'm getting my head in the code to understand it better.

In reply to Sam Hemelryk

Re: Adding all categories and courses to the custom menu

by Trem_r Trem_r -

Well I spent a few time trying to understand how the new renderer works, and tried something on it that someone might find useful ; this is a small variation that displays Category(ies) name(s) instead of "Courses" :

it just does the same as the old code, but gets up one level the category(ies) display in the menu, and gets rid of the "Courses" first level menu.

I think it may be simplified more but it's a first step for anyone starting to work on this, you can find the renderers.php attached to this message.

One of the issues I don't know how to fix is that the custom menu is alphabetically ordered between dynamic category contents and static custom menu items, and I'll be looking for a way to order it differently in the future (static content on a side, dynamic on the other for example). If you have a clue let me know.

In reply to Trem_r Trem_r

Re: Adding all categories and courses to the custom menu

by Mary Evans -

Hi, I was planning on not using the custom menu for general use. I just want to use this method that Sam has given us, for courses and categories. So the problem you are faceing Tram is not relevent to my project.

But I dare say you could split the content of the menu into two. Left and right side. I'm not quite sure how, mind you, but if you think on it long enough, the Muse of PHP will eventually pass by, and put the solution to this idea in your head, one day when you are not thinking about it. smile