-
Notifications
You must be signed in to change notification settings - Fork 194
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
Render menu containing only siblings of active menu item #153
Comments
Can you give an example where it can be useful ? I'm trying to imagine "why". Notice that there's an easy way to do but we were talking about deleting it because it's a problem in the code to implemente more cool things. |
Sure. I want to limit my main nav bar to just show two levels of depth in the menu, but the menu may be much deeper. When someone is on one of those pages, I want to introduce another navigation in a sidebar that contains the remaining pages. Here's an example of a website that does it: http://www.bu.edu/cs/undergraduate/computer-science-major The main menu on the top contains two levels of items. But if you click on Undergraduate for instance, there's a new nav on the right that contains remaining children. |
Has anyone figure out how to do this or is a custom template required? It appears I can limit the depth in using the |
I also need this and it seems there is no really alternative to knpmenu on symfony. I also can't find out what matchingDepth does. Has anyone found a solution in this 5 years the bug is open now? |
|
I'm curious, is there a way to render a partial menu containing siblings (and maybe children) of the current menu item?
Given a menu tree:
If the user is on the
Large Ball
page, I'd like to be able to render all siblings. In my real case, they would be rendered as tabs.#84 may be the same thing, but it seems like that use case is actually rendering all the ancestors as well.
It seems I can do this:
But that would require that I know the name of the current menu item. If I can get that in twig somehow, I guess that would be fine and I could just fill it in there, but ideally there'd be some baked in functionality to support rendering sub-trees.
The text was updated successfully, but these errors were encountered: