The default Wagtail page model includes the "Show in Menu" option on the promote tab. I've been searching through the documentation for awhile now trying to find more information about how this works and I don't see anything.
What is this option used for, and how do I hook into that field so that I can build a simple list of links to be used is some arbitrary template like a footer?
Am I supposed to just build my own queryset of page models and then filter on that value, or is there a simpler utility include with Wagtail that I can use directly?
CodePudding user response:
The Wagtail Getting Started section could use some information about how to use 'show in menu' to create menus. Until that gets added, try this tutorial for how to use this 'from scratch': https://www.accordbox.com/blog/how-to-create-and-manage-menus-in-wagtail/
Or install wagtailmenus per instructions in this tutorial: https://engineertodeveloper.com/wagtail-site-navigation/
(At work we built ours by hand but if we were doing it over, I would definitely look into wagtailmenus)
CodePudding user response:
This is a generic field that is available on Page
models that does not do anything by default.
While the documentation is not the clearest, the only thing this impacts is whether the page is returned in in_menu()
querysets.
As Wagtail does not make assumptions about what your frontend (front facing pages) will look like it is up to you to determine what this field means for your application.
Additional links
- https://wagtailmenus.readthedocs.io/en/stable/ - a package for building complex menus within Wagtail
- https://www.accordbox.com/blog/how-to-create-and-manage-menus-in-wagtail/ - good tutorial on building custom Wagtail menus