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

An exploration into improving the site navigation experience #48034

Open
richtabor opened this issue Feb 13, 2023 · 7 comments
Open

An exploration into improving the site navigation experience #48034

richtabor opened this issue Feb 13, 2023 · 7 comments
Labels
[Block] Navigation Affects the Navigation Block [Block] Page List Affects the Page List Block Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

Recap: the current state of Page List navigation

Block themes, and now core header patterns, use the core/navigation block with a core/page-list block within.

The main advantage of using the Page List block is that a site’s pages are automatically added to the navigation. You don’t have to figure out how to add a page to the navigation upon creating a page — the action is one in the same.

But as soon as you want to personalize the navigation (remove a page/rearrange the pages/add a link between existing navigation items) you have to convert the Page List block to individual links. As is, the Page List block is one "locked" unit.

CleanShot 2023-02-13 at 10 48 11

However, converting the Page List block to individual navigation items means you loose the relationship between publishing a page and having it show up in the navigation automatically.

There seems an opportunity to remove the locked nature of the Page List block, affording more personalization with the out-of-the-box Page List block, while still allowing pages to be added automatically to the site navigation.


Unlocking the Page List block

What if the Page List block's items were not locked… if you could rearrange the order of pages on your site and still have new pages auto-added to the navigation? Sure there will be instances where you don't want pages showing up in the site (main) navigation, though it'd be easier to hide — than it is to find and add items.

One idea is that the Page List block orders pages by custom order first — then by publish order. I.E. If you add a new page, it’s automatically added to the end of the Page List block. If I move that new page first in the list, that page is always first — and any future pages will be added to the end.


Control to show/hide a page when publishing

Perhaps we could have a method for pages to opt in/out of displaying in the Page List automatically. This could be a control in the page post type publish panel (as well as pre-publish checks) or maybe even a way to override the default behavior ("Always add new pages to the site navigation?").

Deciding at the page creation point could be an interesting way to reduce the friction of adding navigation items.

CleanShot 2023-02-13 at 10 45 55


See all pages from the Navigation/Page List

Another exploration that would be interesting, is if the site navigation list revealed all the site’s pages. This way you could see the available pages right off, and choose which to show or hide. This contrasts with today's experience where you have to recall the available pages, search for them, then add — after converting the Page List block to individual links first.

CleanShot 2023-02-13 at 10 51 24


There's a lot of potential for out-of-the-box navigation experiences that are ready-to-go, but also personalizable.

Leveraging the Page List block seems the first step for improving this experience. Connecting the action of publishing pages and adding to navigation further would be interesting to dive in on next.

What do you think?

@richtabor richtabor added [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. [Block] Navigation Affects the Navigation Block [Block] Page List Affects the Page List Block labels Feb 13, 2023
@richtabor
Copy link
Member Author

richtabor commented Feb 13, 2023

Related in part #47064 and #47058

@scruffian
Copy link
Contributor

Thanks for this @richtabor, I think there are some great ideas here.

Leveraging the Page List block seems the first step for improving this experience.

I agree with this. We are already using the Page List block as the foundation for navigation menus, so the more we can add affordances to that block the more users will benefit.

One idea is that the Page List block orders pages by custom order first — then by publish order. I.E. If you add a new page, it’s automatically added to the end of the Page List block. If I move that new page first in the list, that page is always first — and any future pages will be added to the end.

We already have a mechanism in pages to define an order, in wp-admin:

Screenshot 2023-02-13 at 17 56 02

It works like you are saying. The only thing we need to do is make it possible to update this from the Page List UI rather than in wp-admin. Ultimately this should be possible via drag and drop but maybe as a first iteration we could make it available as part of the page link item UI at first?
Screenshot 2023-02-13 at 17 57 38

I also like the idea to show all pages and then decide which ones to hide. This is more involved as we don't have a mechanism for hiding pages in wp-admin yet. I think there are two options here and I'm not sure which is best:

  1. This could be a setting that only the block knows about - so the list hidden pages are stored in the block. This is good as it gives you the option to hide different pages in different navigations.
  2. This could be a new setting in wp-admin. This would mean that once a page is hidden in one navigation, it's hidden in all of them.

Which of these do you think would be more useful?

@richtabor
Copy link
Member Author

richtabor commented Feb 13, 2023

Ultimately this should be possible via drag and drop but maybe as a first iteration we could make it available as part of the page link item UI at first?

Yea that could prove it out. Although I don't think it should stay an input in the UI. Dragging/dropping works for all other navigation items (outside of Page List); I'd expect it to work for Page List as well.

Is it much more difficult to enable it via drag and drop?

I also like the idea to show all pages and then decide which ones to hide. This is more involved as we don't have a mechanism for hiding pages in wp-admin yet. I think there are two options here and I'm not sure which is best:

I would think that if I choose to hide the "Locations" page from my site's main navigation, then that would be hidden from that main navigation — not all other navigation instances throughout my site.

With the concept of choosing to add a page to the site's main navigation on publish (future potential scenario), if I choose to omit a page from the navigation, it should be hidden from all navigation instances on my site.

@scruffian
Copy link
Contributor

Is it much more difficult to enable it via drag and drop?

There are two complexities that come with drag and drop:

  1. It's not accessible, so we would always need an accessible alternative, although the block movers would give us that
  2. If you change the order of the bottom item to be at the top of the list, it would require changing the order of every item in the list, which makes it more complex

Would you expect the order of the items in the page list to be different for each navigation block, or the same, based on their order in the pages heirarchy?

@SaxonF
Copy link
Contributor

SaxonF commented Feb 15, 2023

I can imagine dragging/re-ordering items in a page list block without unlinking is a pretty common use case so could see that being a nice next step / separate task.

We have the ability to only show children under a parent now which is a good start in terms of filtering what it shows.

I think we should gather more feedback/research before moving forward with any further page filtering mechanisms. e.g. a setting in page inspector. It feels like it could be catering to edge cases / over optimisations that might not be a priority right now.

@scruffian
Copy link
Contributor

I created an issue for the ordering specifically: #48125

@richtabor
Copy link
Member Author

Would you expect the order of the items in the page list to be different for each navigation block, or the same, based on their order in the pages heirarchy?

Yes, I'd expect they could be different per navigation instances.

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 [Block] Page List Affects the Page List Block Needs Design Needs design efforts. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants