Wagtailmenus 2.6.0 release notes¶
Wagtailmenus 2.6 is designated a Long Term Support (LTS) release. Long Term Support releases will continue to receive maintenance updates as necessary to address security and data-loss related issues, up until the next LTS release (for at least 8 months).
Wagtailmenus 2.6 will be the last LTS release to support Python 2 or Python 3.3.
Wagtailmenus 2.6 will be the last LTS release to support Wagtail versions 1.5 to 1.9.
Improved compatibility with alternative template backends¶
Wagtailmenus has been updated to use backend-specific templates for rendering, making it compatible with template backends other than Django’s default backend (such as
Although the likelihood of this new behaviour introducing breaking changes to projects is minute, it is turned OFF by default for now, in order to give developers time to make any necessary changes. However, by version 2.8 the updated behaviour will replace the old behaviour completely, becoming non optional.
To start using wagtailmenus with an alternative backend now (or to test your project’s compatibility in advance), you can turn the updated behaviour ON by adding the following to your project’s settings:
WAGTAILMENUS_USE_BACKEND_SPECIFIC_TEMPLATES = True
Thank you to Nguyễn Hồng Quân (@hongquan) for contributing this!
New tabbed interface for menu editing¶
In an effort to improve the menu editing UI, Wagtail’s
TabbedInterface is now used to split a menu’s fields into two tabs for editing: Content and Settings; with the latter including panels for the
use_specific fields (which were previously tucked away at the bottom of the edit page), and the former for everything else.
Two new attributes,
settings_panels have also been added to
AbstractFlatMenu to allow the panels for each tab to be updated independently.
If for any reason you don’t wish to use the tabbed interface for editing custom menu models, the
panels attribute is still supported, and will setting that will result in all fields appearing in a single list (as before). However, the
panels attribute currently present on the
AbstractMainMenu models is now deprecated and will be removed in the future releases (see below for more info).
Built-in compatibility with
In an effort to improve the menu editing UI, wagtailmenus now has baked-in compatibility with
wagtail-condensedinlinepanel. As long as a compatible version (at least 0.3) of the app is installed, wagtailmenus will automatically use
CondensedInlinePanel instead of Wagtail’s built-in
InlinePanel for listing menu items, giving menu editors some excellent additional features, including drag-and-drop reordering and the ability to add a new item into any position.
If you have custom Menu models in your project that use the
panels attribute to customise arrangement of fields in the editing UI, you might need to change the your panel list slightly in order to see the improved menu items list after installing. Where you might currently have something like:
class CustomMainMenu(AbstractMainMenu): ... panels = ( ... InlinePanel('custom_menu_items'), .. ) class CustomFlatMenu(AbstractFlatMenu): ... panels = ( ... InlinePanel('custom_menu_items'), .. )
You should import
wagtailmenus.panels and use them instead like so:
from wagtailmenus.panels import FlatMenuItemsInlinePanel, MainMenuItemsInlinePanel class CustomMainMenu(AbstractMainMenu): ... panels = ( ... MainMenuItemsInlinePanel(), # no need to pass any arguments! .. ) class CustomFlatMenu(AbstractFlatMenu): ... panels = ( ... FlatMenuItemsInlinePanel(), # no need to pass any arguments! .. )
This method is deprecated in favour of using Django’s generic ‘get_template’ and ‘select_template’ methods, which return backend-specific template instances instead of django.template.Template instances.
If you are referencing
AbstractFlatMenu.panels anywhere, you should update your code to reference the
settings_panels attribute instead, depending on which panels you’re trying to make use of.
If you’re overriding the
panels attribute on a custom menu model in order to make additional fields available in the editing UI (or change the default field display order), you might also want to think about updating your code to override the
settings_panels attributes instead, which will result in fields being split between two tabs (Content and Settings). However, this is entirely optional.
- Following the standard deprecation period, any
modify_submenu_items()methods implemented on custom Page type models must now accept a ‘use_absolute_page_urls’ keyword argument. See the 2.4 release notes for more info: http://wagtailmenus.readthedocs.io/en/stable/releases/2.4.0.html