wagtail / wagtail

A Django content management system focused on flexibility and user experience
https://wagtail.org
BSD 3-Clause "New" or "Revised" License
17.83k stars 3.76k forks source link

Define custom, hierarchical navigation menus #7767

Open brylie opened 2 years ago

brylie commented 2 years ago

Is your proposal related to a problem?

Navigation is a critical part of content management/architecture. However, while Wagtail provides an excellent framework for defining and managing content types, there is little support for allowing content editors to work with site navigation.

Wagtail, confusingly, has a "Show in menus" checkbox when creating pages while there is no meaningful way to define or manage the menus.

image

Describe the solution you'd like

I want to define and modify one or more hierarchical navigation menus through the Wagtail Admin UI. For example, a developer might define the navigation menu identifiers or template region in advance to render navigation menus in the correct place.

Describe alternatives you've considered

I've used the wagtailmenus plugin, which seems to no longer be maintained.

Additional context

Navigation is a first-class concern with popular CMS solutions like WordPress and Drupal.

aliceni81 commented 2 years ago

Totally agree. Is there any plans to add the feature of menu in Wagtail?

lb- commented 2 years ago

Not necessarily a solution to this but the docs should be updated at the next release with some clarification on what show_in_menus does and does not do.

https://github.com/wagtail/wagtail/pull/8072

Additional to this, Wagtail usually avoids making too many decisions about what the front facing page content should look like. It may not be practical to have a core menu system that supports a spectrum of use cases.

I can see jazzband have taken over the project now so there may be some movement on the maintenance of that package https://github.com/jazzband/wagtailmenus/issues/409

lb- commented 2 years ago

Adding label needs design decision.

brylie commented 2 years ago

Additional to this, Wagtail usually avoids making too many decisions about what the front facing page content should look like. It may not be practical to have a core menu system that supports a spectrum of use cases.

Just a point for consideration: WordPress is fairly agnostic and flexible when it comes to front-end design, yet provides a user-friendly way to define custom, hierarchical navigation menus that can be integrated into front-end themes.

lb- commented 2 years ago

We have been discussing this with some of the core team and there is agreement that it would be nice, long term, for Wagtail to provide more help with managing menus. However, that does not mean that there will be a focus for this to be built any time soon.

Menu management does seem like a pretty basic feature of most content management systems, and Wagtail’s show_in_menus makes it seem like Wagtail intends to have some support for generating menus.

Here is the suggested way forward

This is not really an answer along the lines of 'yes this will be built' but gives some options for smaller steps towards an eventual core implementation if that makes sense in the future.

We would love any feedback on the ideas above and of course anyone that wants to contribute towards these steps is welcome to.

janbaykara commented 2 years ago

I think if menus are on the roadmap now, but aren't yet implemented, then hiding the 'show_in_menu' option and defaulting it to 'True' might be good enough for now.

I wonder if wagtail could take ownership of the wagtailmenus repo, like it has with wagtail-localize, because as per https://github.com/jazzband/wagtailmenus/issues/409 an a named lead maintainer has not been identified yet, even if Jazzband has nominally taken on the task.

lb- commented 2 years ago

Thanks for the feedback @janbaykara - some additional thoughts below.

show_in_menu default

Wagtail ownership of wagtailmenus

hazho commented 2 years ago

the simplest way is to implement a (per site) public streamfields block for this, the following gist is an example, that can be customized and enhanced based on any use cases (even having multiple templates to be chosen by the admins) https://gist.github.com/hazho/ef9d6992893c46a3a3acf9b2667719e7

lb- commented 1 year ago

Wagtail menus has now been updated to support the latest version of Wagtail. https://github.com/jazzband/wagtailmenus/releases/tag/v3.1.4