The top navigation menu includes entries that are generated by default but you may want to include additional menu entries that are unique to your learning management system (LMS).
The Custom Menu allows you to create your own menu entries, specify their order, and specify which users will be able to see the menu entries based on their permissions.
Background
The Custom menu items text box allows you to add new menu entries; one menu entry per line. To access the custom menu:
- Go to Site Administration > Appearance > Themes > Dual Code > Custom Menu.
Structure of the Menu Entries
Each line consists of required and optional parameters separated by the pipe “|” character. The parameters include:
- the menu text
- a link URL (optional)
- a tooltip title (optional)
- a language code or comma-separated list of codes for displaying the menu entry to users of the specified language only (optional)
- a capability or comma-separated list of capabilities for displaying the menu entry to users with the specified system capability only (optional).
Following is an example of a menu entry with all available options.
FAQ|/our-lms-faq |FAQ|en|local/dualcode:authenticated
In this example, a menu entry name FAQ will display HTML page called “our-lms-faq” when the site is viewed in English and the user is logged in.
Restricting Access to a Menu
Custom menus items will be visible to all users, including users who haven't logged in, unless you restrict access to them by specifying required capabilities.
A common requirement is to show different menus to authenticated users and non-authenticated users. To facilitate this requirement, you should be aware of the following common capabilities:
User Group | Menu Option |
---|---|
Logged in users only | local/dualcode:authenticated |
Non-logged in users only | local/dualcode:notauthenticated |
Anyone with editing privileges on the site | local/pages:manage |
Everyone | no option is required |
Note: When a custom menu item is associated with local/dualcode:authenticated, users will need to log into the system to see it. Likewise, when a custom menu is associated with local/dualcode:notauthenticated, users will see the menu item so long as they have not signed into the application.
Any capability in the system can be used to restrict access to a menu item. For an exhastive list of capabilities, see https://docs.moodle.org/31/en/Category:Capabilities
Creating Submenus
Submenu entries are created by putting a dash “-“ at the start of the line. For example:
FAQ
-Standard Topics|/standard_topics
-Special Topics|/special_topics
In this case FAQ would be the main menu entry and “Standard Topics” and “Special Topics” would appear in the drop-down menu when you click FAQ.