Sub Sub Menu is not working in Moodle 4

Sub Sub Menu is not working in Moodle 4

by Mohamed Atia -
Number of replies: 7

I am facing an issue while creating a custom menu for our website. The menu was functioning properly in Moodle 3.11, but after updating to Moodle 4 or a later version, I noticed that the sub-sub menu is not being displayed. I have provided the code below that I used for the custom menu. In the attached screenshot, you can see that the "Cybersecurity Academy," which is a sub-menu of "Academies," appears correctly. However, the sub-menus "Adult" and "Kids" under "Cybersecurity Academy" are not visible. I would like to know if there have been any changes in syntax in Moodle 4 or if there is a specific way to enable sub-sub menus. I have also tried using the Boost theme, but the issue persists.

Here is the code I used:

Home|/?redirect=0|Home|en

Our Experts|/mod/page/view.php?id=8725|Our Experts|en

Academies |/mod/page/view.php?id=8694|Academies|en

-Cybersecurity Academy||CS Academy|en

--Adult|/mod/page/view.php?id=14056|Adult CS Academy|en

--Kids||Kids CS Academy|en

Freelancing Initiative|/mod/page/view.php?id=10447|Freelancing Initiative|en

Signs Language|/mod/page/view.php?id=10447|Signs Language|en

Contact|/mod/page/view.php?id=201|Contact|en


Average of ratings: -
In reply to Mohamed Atia

Re: Sub Sub Menu is not working in Moodle 4

by Ken Task -
Picture of Particularly helpful Moodlers
Cannot use relative addressing.
Must use full url to site:

As example your:

Our Experts|/mod/page/view.php?id=8725|Our Experts|en

Changed to:
Our Experts|https://yoursite/mod/page/view.php?id=8725
Should work.

'SoS', Ken


In reply to Ken Task

Re: Sub Sub Menu is not working in Moodle 4

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Ken

The custom menu accepts the 'path' part of the URL. For example this is what I've used in this example, A side-by-side comparison of themes for Moodle 4.1 (LTS):

Theme switch
-Adaptable|/course/view.php?id=2&theme=adaptable
-Almondb|/course/view.php?id=2&theme=almondb
About the sub-sub-menu, I don't know, from what I remember many themes never supported sub-sub-menus. Somebody needs to explore.

In reply to Visvanath Ratnaweera

Re: Sub Sub Menu is not working in Moodle 4

by Ken Task -
Picture of Particularly helpful Moodlers
Sub-Sub supposed to be two 'dashes' - like --
as he shows in his Academies

Academies
  Cypersecurity
      Adult (sub sub)
      Kids (sub sub)

Academies |/mod/page/view.php?id=8694|Academies|en

-Cybersecurity Academy||CS Academy|en

--Adult|/mod/page/view.php?id=14056|Adult CS Academy|en

--Kids|/mod/blah|Kids CS Academy|en

However, have never seen any one try the title repeat |Adult CS Academy with language opiton ... |language before.

Is the |CS Academy |language necessary?

I use drop down menus but only go one level deep - not 2 (sub sub).

Anyhoo ...

'SoS', Ken

In reply to Ken Task

Re: Sub Sub Menu is not working in Moodle 4

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
None of the themes in my A side-by-side comparison of themes for Moodle 4.1 (LTS) supports second-level custom menus. This is what I have:

Sports
-Athletics
--London Marathon|https://www.tcslondonmarathon.com/
--Winterthur Marathon|https://winterthur-marathon.ch/
-Basketball
--NBA|https://www.nba.com/

BTW, I am playing with the Theme switch custom menu. This is the current state:

Theme switch
-Adaptable|/?theme=adaptable
-Almondb|/?theme=almondb
In reply to Ken Task

Re: Sub Sub Menu is not working in Moodle 4

by Mohamed Atia -
Hi Ken,

Thanks for your response. Relative paths are working great and save me time when transitioning between staging and development. I've been using them for years. My question is about sub-menus (-) and sub-sub menus (--).

Example:
Academies
-Sybersecurity
--Awareness
In reply to Mohamed Atia

Re: Sub Sub Menu is not working in Moodle 4

by Ken Task -
Picture of Particularly helpful Moodlers
I too have been using for years + ... my method of madness is to have a text file template and change the FQDN to the site.   Works for me.
But I don't link internally and desire new tabs ...

Using Google
-At Work School|http://learn.googleapps.com/" "target="_new

But ... I see now mine are broken ... once again! sad
So am of no help!   GRRRRRR!

But ... in looking at a 4.0 site using menus I see this help:

A custom menu may be configured here. Enter each menu item on a new line with format: menu text, a link URL (optional, not for a top menu item with sub-items), a tooltip title (optional) and a language code or comma-separated list of codes (optional, for displaying the line to users of the specified language only), separated by pipe characters. Lines starting with a hyphen will appear as menu items in the previous top level menu and ### makes a divider. For example:

Courses
-All courses|/course/
-Course search|/course/search.php
-###
-FAQ|https://example.org/faq
-Preguntas más frecuentes|https://example.org/pmf||es
Mobile app|https://example.org/app|Download our app
and you are saying your sub-sub items are not working ... the -- lines.

So if you have entered them correctly, they should work ... but aren't.
Bug?  Maybe Mr. V has some sub-subs.

'SoS', Ken


In reply to Ken Task

Re: Sub Sub Menu is not working in Moodle 4

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
No, my sub-sub-menus aren't showing either.

This is the custom menu I've added:
Sports
-Athletics
--London Marathon|https://www.tcslondonmarathon.com/
--Winterthur Marathon|https://winterthur-marathon.ch/
-Basketball
--NBA|https://www.nba.com/

This is what it shows: http://training.edunet.lk/001/

Just repeating what I said here https://moodle.org/mod/forum/discuss.php?d=446719#p1795230.