Skip to content

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

@getdave

Description

@getdave

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] NavigationAffects the Navigation Block[Block] Page ListAffects the Page List Block[Block] SubmenuAffects the Submenu Block - for submenus in navigation[Type] FeatureNew feature to highlight in changelogs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions