-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Update the default query for the navigation suggestions #53903
Conversation
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
1 similar comment
Warning: Type of PR label error To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. |
Size Change: +3 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about this one. We already have block variations on the nav item block that change the query on the Link UI based on the type. What's gone wrong here that this isn't working they way we expect? What bug does this fix?
We need a way to modify the suggestions query based on what you input
What use case are we solving for here? Are you thinking we can assess a give input to determine the type of content you are searching for based on what you've typed? That sounds like an impossible task given that Posts and Pages (and other content types) all have similar attributes and naming possibilities.
@getdave this PR is an attempt to address #50432 and its underlying issue: most of the time you want to link to your own content when building a menu. So by default the suggestions we show 1st should be pages, desc by modified date, I think. This pr makes this happen but then all the suggestions are just pages. Which should not be the case. |
I still don't think this is the right way to go about this or that the requirement is clear enough. For example, I can already search for Pages when adding items to my Nav block. What I think we're asking for is
I don't think we can simply omit all other post types from the results. Indeed we tried this in a previous PR by making the I would like us to interrogate the requirement in greater depth before we implement any solution. |
Yeah I think what we need to do is keep the current query but add a sorting option, so that page results are returned first. |
Myself and @richtabor explore a UI by which you could filter the results shown within the Link Control itself but it would default to sensible defaults. So that way we could have the Nav block default to Just one idea... |
What?
Update the query that suggests what to link to from the Navigation Link block.
Why?
When creating a new link it's most likely people will want to link to a page, so we should default to that as a suggestion. Closes #50432.
How?
Updates the default suggestion query when you're using standard navigation link block.
Testing Instructions
Notes
Although this solves one aspect of the issue, but problem is that now suggestions are always restricted to pages. We need a way to modify the suggestions query based on what you input. Alternatively we could find a way to sort the suggestions so that pages are first.