Skip to content

Navigation menu fails to mark page ancestor css class #41597

@Humanify-nl

Description

@Humanify-nl

Description

There is currently no is-menu-ancestor, nor is there a is-page-ancestor css-class in Gutenberg navigation.

Page children of a page-group are not marked in the menu, making it impossible to 'mark' where the user is, when working with many pages and page-groups.

As devs are being 'forced' to use the new menu in FSE mode, with no usable fallback to the old menu screen, it would be great if it at least has all the basic functions that the old menu used to have.

This is mentioned in an earlier issue #25575 from 2020, but nothing happened with it since.

If the navigation block doesn't have link sub-menus current-page-ancestor class isn't added when viewing a child page.

This must be a bug, as it makes no sense in real life website menu's with more then 20 pages on a site.

Step-by-step reproduction instructions

  1. Add a page 'main-parent'.
  2. Add a second page 'main-child', make 'main-parent' its parent.
  3. Add the navigation block and add the link for 'main-parent'.
  4. Open the site on front, and browse to the 'main-child' page.
  5. See that the menu-item 'main-parent' is not marked with any css class.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.0
  • No Gutenberg

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions