-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Mark invalid menu items in Navigation editor and block #23573
Comments
Here's an idea of how these error messages could look on the new navigation screen. Given how small of a space we have for child items of the navigation block, I thought about adding a distinct error highlight that lets you make a correlation between the error notice and the specific block. The errored block is also highlighted in the navigation list on the right. Once you select the errored block, the toolbar can describe the error in more detail and offer a way to fix it: I also thought about how we can avoid getting to this state in the first place. I wonder if I should be able to delete a page without seeing some sort of warning that the page I'm about to delete is being used in my navigation? Maybe if I really wanted to delete it, I could right then and there decide to also remove it from the navigation? @shaunandrews Since you've been working on navigation a lot lately, I'd love to hear what you think. |
Does the presence of a "Page List" block change the equation here? The way I see it, the Page List is the solution to menu items staying in sync. As soon as the Page List block is converted into a list of individual menu items, they are essentially "just" normal hyperlinks. It would be nice with a "dead link checker" tool for such links, but it seems less urgent once the Page List block keeps things in sync automatically. |
Posts can also be deleted though, or categories. If we're aiming for feature parity with |
A setup state recently landed for menu items: This setup state essentially handles "incomplete items". Currently, items without a link. But we are discussing in #29417 (comment) whether it could also be used to handle draft pages. It seems like the same pattern could be extended to invalid items: The genesis of the idea was #28440 by @shaunandrews. In all cases, the key behavior, outside of the block-UI-like button, is that you cannot edit the title of the menu item until the item has been handled. That affords us the entire clickable area to invoke a popover where you can publish/repair/fix the menu item. I would encourage looking at Shaun's mockups in 28440, as they will very probably scale well to this. What do you think? |
Just noting that this is still not handled by the Nav Editor screen. Added to the tracking issue #29102. |
@jasmussen Is this still something we are going pursue? |
@getdave @jasmussen If so, this PR is ready for review again. It has an approval, but it was granted way too long ago. |
Yes, this needs to be done for feature parity with classic menus, and for better UX. |
Ok it's added to the new tracking issue. |
Closed by #31716 |
Is your feature request related to a problem? Please describe.
In the
nav-menus.php
admin section, invalid menu items are flagged with a red background and an error message appears:The Navigation screen should also have something like this.
(An invalid menu item can be created by deleting the page a menu item links to.)
Describe the solution you'd like
Show an error message in the Navigation screen when there are invalid items, and indicate within the menu which items are invalid.
Whatever way we find of showing invalid menu items should perhaps also be applied in the Navigation block itself.
Details from #34818
A nav menu_item object returned from calling wp_setup_nav_menu_item. This object contains a property called
_invalid
. It is used for the following.A menu item can be invalid for the following reasons.
The new navigation editor should handle this case. See the existing menu screens.
Related: #34670
The text was updated successfully, but these errors were encountered: