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

Automatically insert a Page List block on insertion of Submenu block #42598

Open
getdave opened this issue Jul 21, 2022 · 4 comments
Open

Automatically insert a Page List block on insertion of Submenu block #42598

getdave opened this issue Jul 21, 2022 · 4 comments
Labels
[Block] Navigation Affects the Navigation Block [Block] Page List Affects the Page List Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Feature New feature to highlight in changelogs.

Comments

@getdave
Copy link
Contributor

getdave commented Jul 21, 2022

What problem does this address?

When building a Navigation menu, a very common pattern is to have manually created top level items. For example:

  • Home
  • About
  • Projects
  • Contact

When adding submenus to these items however, it is often the case that these should be dynamically generated. For example in the example above the site may have created several "project" pages under the parent Project page.

What is your proposed solution?

To avoid a situation where the site owner is having to constantly update the Navigation each time a "project" is added, we can add a Submenu block underneath Project and add a Page List block as the only child. This Page List should be configured to only display Pages which are children of the Project page.

Note: this should only happen when the parent of the submenu is a Page.

As the Page List block is dynamic, it will automatically updated to show the latest "projects" as they are added.

However, the work outlined above adds a fair bit of overhead for what is likely to be a common pattern. Therefore we should update the Submenu block to automatically insert a Page List block which is preconfigured to show Pages which are children of the parent Navigation item under which the submenu is nested.

To achieve this we will need to update the Page List to allow the ability to display pages which are children of another Page.

@getdave getdave added [Block] Navigation Affects the Navigation Block [Type] Feature New feature to highlight in changelogs. [Block] Page List Affects the Page List Block [Block] Submenu Affects the Submenu Block - for submenus in navigation labels Jul 21, 2022
@getdave
Copy link
Contributor Author

getdave commented Jul 21, 2022

This depends on #42599

@carolinan
Copy link
Contributor

This is only when the parent is a page, correct? Not for all submenus?

@getdave
Copy link
Contributor Author

getdave commented Jul 21, 2022

This is only when the parent is a page, correct? Not for all submenus?

I updated the description. Thanks for spotting that and the confidence check 🙇‍♂️

@talldan
Copy link
Contributor

talldan commented Jul 25, 2022

#31063 is related. There's also an old PR open for that which may be of some use - #31471. It adds parent filtering to the page list block, but only based on the current page.

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 [Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Feature New feature to highlight in changelogs.
Projects
None yet
Development

No branches or pull requests

3 participants