Skip to content

Customise initial suggestions in Navigation Link to show Pages by default #35104

Closed

Description

@tellthemachines

What problem does this address?

Prompted by experiments and discussions around Navigation Link block defaults and variations in #34899 and #35056.

When inserting a Navigation Link with no specific variation, the link control should show Pages by default in the initial suggestions. We want to optimise Navigation Link for adding Pages, because that is likely the most used type, while still providing the flexibility to search for other post types or taxonomies in the link control search bar.

What is your proposed solution?

Look into Link Control component to see if any changes are needed there, or if we can pass it parameters to customise the initial suggestions query. (I haven't looked into this beyond noticing there is a showInitialSuggestions prop for LinkControl that is a boolean, and it's not obvious from the list of props if those suggestions can be customised.)

Ideally we'd be able to provide LinkControl with query parameters for the initial suggestions, without limiting subsequent queries from the search bar to those particular parameters.

Activity

  1. added
    [Block] Navigation Link
    [Feature] Link Editing
    on Sep 24, 2021
  2. jasmussen commented on Sep 24, 2021

    @jasmussen
    Contributor

    Thank you. One of the challenges with the URL dialog is that it always shows the most recent items, with no option to browse deeper without search. Based on much older explorations by @shaunandrews, can we actually show a scrollable list of pages?

    page link

    If there are more than n items in total, we could revert back to recent pages (though still show more than 3).

    As posted elsewhere, if we know what block type opens the URL dialog, it would be nice to tailor it to that post type:

    all

  3. tellthemachines commented on Sep 29, 2021

    @tellthemachines
    ContributorAuthor

    Based on much older explorations by @shaunandrews, can we actually show a scrollable list of pages?

    We can do that! In fact, scroll is already enabled in the Navigation editor if you'd like to test it 😄

  4. jasmussen commented on Sep 29, 2021

    @jasmussen
    Contributor

    In fact, scroll is already enabled in the Navigation editor if you'd like to test it 😄

    Nice:
    Screenshot 2021-09-29 at 09 53 21

    For such a constrained context as this, and to ensure both contrast and that the scrollbar doesn't fade out on some systems, I do wish we could leverage a custom styled scrollbar. But last I looked into this, in order to work well, we'd need the scrollbar-gutter feature implemented.

    More importantly than scroll, though, I feel like the key problem to solve here is that showing the n most recently published items and then falling back to search, is not a good experience when building page structures. You have to remember the page structure and then re-create it. I understand that inferring what to show based on link variations is maybe not ideal, but it would be great if we found some creative solution that offered a hierarchical list of pages for the nav menu.

    Edit: today I learned that ⌘+Enter submits the comment. Therefore most of the above was added in an edit. Sorry about that.

  5. added
    [Type] Enhancement
    on Aug 18, 2023
  6. tellthemachines commented on Aug 10, 2026

    @tellthemachines
    ContributorAuthor

    Closing as this has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Navigation Link[Feature] Link Editing[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions