Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore new hook-based extension mechanism for the primary navigation #180

Open
stopfstedt opened this issue Apr 5, 2024 · 1 comment
Open

Comments

@stopfstedt
Copy link
Member

Currently, we're extending the primary nav class in order to drive course-category-specific items into the primary navigation.
With M4.3, there is now a new mechanism for extending the primary nav that does not require sub-classing.

https://tracker.moodle.org/browse/MDL-79088

This may even allow us to extract this feature into a standalone plugin.

Also check out the reference implementation https://github.com/marinaglancy/moodle-tool_sitenavdemo

@stopfstedt
Copy link
Member Author

couple of notes:

  • rigging up the hook is really easy to accomplish
  • the custom_menu API that we're currently using to push our category-based additions into the primary nav will not work here. it is incompatible with the interface that core\navigation\views\primary is providing.
  • we'd therefore have to provide our own input parser, which could be modeled on custom_menu::convert_text_to_menu_nodes()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant