Open richtabor opened 1 year ago
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:
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?
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:
Which of these do you think would be more useful?
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.
Is it much more difficult to enable it via drag and drop?
There are two complexities that come with drag and drop:
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?
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.
I created an issue for the ordering specifically: https://github.com/WordPress/gutenberg/issues/48125
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.
Recap: the current state of Page List navigation
Block themes, and now core header patterns, use the
core/navigation
block with acore/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.
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.
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.
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?