Thanks for clarifying! You want to add more options to the blue horizontal course menu bar—the one showing Course, Participants, Grades, Activities, Competencies (see your screenshot). This menu is specific to each course and appears right below the site’s main menu.
This menu is controlled by Moodle's course navigation (also called the "secondary navigation" or "course nav tabs") and is populated based on:
- The course format
- User roles/capabilities
- Enabled plugins and activities
- Theme overrides (sometimes)
How to Add More Tabs to the Course Menu
1. Easiest: Add a Resource or Activity
- Enabling a plugin (like "Grades", "Competencies", or any new activity) will automatically add its tab for relevant users.
- If you want a tab for an external link, see the “Plugin” method below.
2. Programmatically Add Custom Tabs (Recommended for Custom Items)
You can add tabs using a local plugin that hooks into the navigation API. Here’s how:
A. Create a Local Plugin with Navigation Extension
Create a new directory:
/local/yourcustomtabs/
Add a version.php
and lib.php
.
In lib.php
, add this function:
function local_yourcustomtabs_extend_navigation_course(navigation_node $parentnode, stdClass $course, context_course $context) {
// Add a tab named "My Custom Tab"
$parentnode->add(
'My Custom Tab',
new moodle_url('/local/yourcustomtabs/page.php', array('id' => $course->id)),
navigation_node::TYPE_CUSTOM,
null,
'mycustomtabid'
);
}
Visit your course and your new tab should appear for users with access.
B. Use an Existing Plugin
- Format plugins (like
format_tabs
, format_topics
, etc.) sometimes allow extra menu customization.
- Some themes let you configure secondary menu items, but most require code/plugin.
3. Advanced: Theme Override
- If you want full control, you can override the template that renders the course navigation in your custom theme (for developers).
Summary Table
| Option | What It Does | Difficulty | When To Use |
| --------------------------------------------- | -------------------------------------------- | ---------- | -------------------------------- |
| Add Activity/Plugin | Adds tab for enabled activities (default) | Easy | Built-in activities, plugins |
| Local Plugin (extend_navigation_course) | Adds fully custom tab to every course | Medium | Custom links/pages, full control |
| Theme Template Override | Override navigation rendering at theme level | Advanced | Custom visual/design needs |
Want a Step-by-Step Plugin Example?
If you want, I can give you a ready-to-use plugin example (local/devopscustomtab
) that you just upload and activate—no coding required.
Or, let me know what you want your new tab to link to (external link, internal page, etc.), and I’ll tailor the code for you!