-
Notifications
You must be signed in to change notification settings - Fork 676
Description
We should introduce more advanced menu management on this demo site, to demonstrate Wagtail’s capabilities that are relevant on real-world projects, and so we can improve this type of interface in the CMS.
As-is menus
Currently this demo site has a very simple main menu implementation that relies on Wagtail’s built-in show_in_menus:
bakerydemo/bakerydemo/base/templatetags/navigation_tags.py
Lines 30 to 32 in 6a16f1b
| def top_menu(context, parent, calling_page=None): | |
| menuitems = parent.get_children().live().in_menu() | |
| for menuitem in menuitems: |
There are no other menus on the site.
Desired state
Either refactor the main menu to use StreamField blocks, or introduce a new "footer menu" using blocks, or both. This would include support for:
- Overriding pages’ titles to use text that is better suited as menu item labels
- Reordering menu items without changing the order of the page
- External links and document links in menus
- Settings preview (PreviewableMixin compatibility for settings #11347, shipped in Wagtail 7.1)
- Interesting / more advanced StreamField patterns (Even more complex StreamField instances #539)
- A demo of a "link to anything" use case.
As an example, see the wagtail.org navigation models and blocks.
Working on this
I think the first step should be confirming whether we want to do this for the existing main menu, or a new footer menu, or both. It’s probably simpler to do it for the footer first, but ideally in a way that is suitable for both use cases.
For the footer, we can have a two-level menu like wagtail.org, where the first "sections" level are headings that aren’t clickable, and within each section there is a list of menu items. Each of which can be links to pages, or external, or documents.