Automatically insert a Page List block on insertion of Submenu block #42598
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.
What problem does this address?
When building a Navigation menu, a very common pattern is to have manually created top level items. For example:
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 theProject
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.
The text was updated successfully, but these errors were encountered: