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

Navigation Block - Add support for current-page-ancestor #25575

Closed
nathanp opened this issue Sep 23, 2020 · 4 comments
Closed

Navigation Block - Add support for current-page-ancestor #25575

nathanp opened this issue Sep 23, 2020 · 4 comments
Labels
[Block] Navigation Affects the Navigation Block Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement. [Type] Feature New feature to highlight in changelogs. [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@nathanp
Copy link

nathanp commented Sep 23, 2020

The navigation block currently supports the current-menu-item class, which is helpful when wanting to indicate the user is on a specific page.

What would make this even more useful is adding support for the current-page-ancestor and similar classes.

If there's a filter or something I could use in the meantime, that would be helpful.

Thanks!

@mapk mapk added [Block] Navigation Affects the Navigation Block Needs Technical Feedback Needs testing from a developer perspective. labels Sep 24, 2020
@mtias mtias added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Sep 26, 2020
@mtias
Copy link
Member

mtias commented Sep 26, 2020

Agreed all the standard menu classes should be supported.

@pauldrummond
Copy link

pauldrummond commented May 19, 2022

If the navigation block doesn't have link sub-menus current-page-ancestor class isn't added when viewing a child page. For example, if I'm currently viewing www.mysite.com/books/book1/ I want the link to www.mysite.com/books/ in the nav block to have the current-page-ancestor class.
I've written a simple plugin to handle this client-side with vanilla Javascript. Not sure how to handle it on the server side though.

@Marc-pi
Copy link

Marc-pi commented Jul 11, 2022

#40778

@aristath
Copy link
Member

aristath commented Dec 1, 2022

Fixed in #40778

@aristath aristath closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block Needs Technical Feedback Needs testing from a developer perspective. [Type] Enhancement A suggestion for improvement. [Type] Feature New feature to highlight in changelogs. [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

7 participants