Skip to content

v2.9.0

Compare
Choose a tag to compare
@ababic ababic released this 06 May 11:37
· 325 commits to master since this release

What's new?

Menu tags will now automatically identify level-specific templates

To make it easier to define templates for menus with three or more levels, each menu class has been updated to look for and use level-specific templates in your template directory. For example, for a main menu with three levels, you could arrange your templates like so:

templates
└── menus
    └── main
        ├── level_1.html
        ├── level_2.html
        └── level_3.html

With this the arrangement, the {% main_menu %} tag would find and use level_1.html to render the first level of menu items, then any calls made to {% sub_menu %} from within that template would use level_2.html, then any further calls to {% sub_menu %} from that template would use level_3.html.

See the updated documentation for more information and examples:
http://wagtailmenus.readthedocs.io/en/v2.9.0/rendering_menus/custom_templates.html#custom-templates-auto

New 'sub_menu_templates' menu tag option allows you to specify templates for multiple levels

To complement the new level-specific template functionality, a new sub_menu_templates option has been added to the main_menu, flat_menu, section_menu and children_menu tags to allow you to specify multiple templates to use at different levels.

For example, if you had a template (e.g abc.html) that you'd like to use for the 2nd level of a section menu, and another (e.g. xyz.html) that you'd like to use for the 3rd, you could specify that by doing the following:

{% section_menu max_levels=3 sub_menu_templates="path/abc.html, path/level_3.html" %}

See the updated doumentation form more information:
http://wagtailmenus.readthedocs.io/en/v2.9.0/rendering_menus/template_tag_reference.html#template-tag-reference

Disable 'Main menu' or 'Flat menu' management options in the Wagtail admin area

Implmented by Michael van de Waeter (mvdwaeter).

Projects come in all shapes and sizes, and not all call for both types of menu. So, to reduce potential confusion for users in the CMS, you can now hide either (or both) the 'Flat menus' and 'Main menu' items from the 'Settings' menu in the admin area (and disables the underlying CMS functionality for each).

See the settings documentation for more information: