Releases: jazzband/wagtailmenus
v2.12.1
Release notes are available at:
http://wagtailmenus.readthedocs.io/en/latest/releases/2.12.1.html
v2.10.1
Release notes are available at:
http://wagtailmenus.readthedocs.io/en/latest/releases/2.10.1.html
v2.13
Release notes are available at:
http://wagtailmenus.readthedocs.io/en/latest/releases/2.13.html
v2.12
Release notes are available at:
http://wagtailmenus.readthedocs.io/en/latest/releases/2.12.html
v2.11.1
Release notes are available at:
https://wagtailmenus.readthedocs.io/en/latest/releases/2.11.1.html
v2.11
Release notes are available at:
http://wagtailmenus.readthedocs.io/en/latest/releases/2.11.html
v2.10
NOTE:
In order to keep wagtailmenus working with the latest versions of Wagtail and Django, with code that is clean and maintainable, this version will be the last feature release to support Wagtail or Django versions earlier than 2.0.
Minor changes & bug fixes
- Optimised
MenuWithMenuItems.get_top_level_items()
andAbstractFlatMenu.get_for_site()
to use fewer database queries. - Configured
sphinxcontrib.spelling
and used to correct spelling errors in docs. - Updated testing and documentation dependencies.
- Added Latin American Spanish translations (thanks to José Luis).
Deprecations
The wagtailmenus.app_settings
module is deprecated
If you're importing this in your project from it's previous location, you should update the import statements in your code to use the new import path.
So, instead of:
from wagtailmenus import app_settings
Do:
from wagtailmenus.conf import settings
The wagtailmenus.constants
module is deprecated
If you're importing this in your project from it's previous location, you should update the import statements in your code to use the new import path.
So, instead of:
from wagtailmenus import constants
Do:
from wagtailmenus.conf import constants
The WAGTAILMENUS_CHILDREN_MENU_CLASS_PATH
setting is deprecated
If you're using this in your project's settings to override the menu class used for rendering children menus, you'll want to change this:
# settings/base.py
WAGTAILMENUS_CHILDREN_MENU_CLASS_PATH = 'project.app.module.Class'
To this (without the "_PATH" on the end):
WAGTAILMENUS_CHILDREN_MENU_CLASS = 'project.app.module.Class'
The WAGTAILMENUS_SECTION_MENU_CLASS_PATH
setting is deprecated
If you're using this in your project's settings to override the menu class used for rendering section menus, you'll want to change this:
# settings/base.py
WAGTAILMENUS_SECTION_MENU_CLASS_PATH = 'project.app.module.Class'
To this (without the "_PATH" on the end):
WAGTAILMENUS_SECTION_MENU_CLASS = 'project.app.module.Class'
Upgrade considerations
FLAT_MENU_MODEL_CLASS
has been removed from app settings
If you're referencing FLAT_MENU_MODEL_CLASS
directly from wagtailmenus' app settings module, then you may need to make some changes.
If you only need the 'model string' for the model (for example, to use in a
ForeignKey
or ManyToManyField
field definition), you should use
wagtailmenus.get_flat_menu_model_string()
instead.
If you need the Django model class itself, use wagtailmenus.get_flat_menu_model()
.
MAIN_MENU_MODEL_CLASS
has been removed from app settings
If you're referencing MAIN_MENU_MODEL_CLASS
directly from wagtailmenus' app settings module, then you may need to make some changes.
If you only need the 'model string' for the model (for example, to use in a ForeignKey
or ManyToManyField
field definition), you should use wagtailmenus.get_main_menu_model_string()
instead.
If you need the Django model class itself, use wagtailmenus.get_main_menu_model()
.
The CHILDREN_MENU_CLASS
app setting no longer returns a class
If you're referencing CHILDREN_MENU_CLASS
attribute on wagtailmenus' app settings module, then you may need to make some changes.
The attribute still exists, but now only returns the import path of the class as a string, rather than the class itself.
If you need to access the class itself, you can use the app settings module's new get_object()
method, like so:
from wagtailmenus.conf import settings
menu_class = settings.get_object('CHILDREN_MENU_CLASS')
The SECTION_MENU_CLASS
app setting no longer returns a class
If you're referencing SECTION_MENU_CLASS
attribute on wagtailmenus' app settings module, then you may need to make some changes.
The attribute still exists, but now only returns the import path of the class as a string, rather than the class itself.
If you need to access the class itself, you can use the app settings module's new get_object()
method, like so:
from wagtailmenus.conf import settings
menu_class = settings.get_object('SECTION_MENU_CLASS')
v2.9.0
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:
v2.8.0
What's new?
Smarter 'active class' attribution for menu items that link to custom URLs
By default, menu items linking to custom URLs are currently only attributed with the 'active' class if their link_url
value matches the path of the current request exactly, producing unexpected results when GET parameters or fragments are added to the end of a link_url
value.
A new and improved approach to active class attribution for custom URL links has now been implemented (by Joshua C. Jackson and Andy Babic), which you can enable by adding WAGTAILMENUS_CUSTOM_URL_SMART_ACTIVE_CLASSES = True
to your project's settings.
With the new approach, only the 'path' part of the link_url
value is used for comparision with request.path
, which produces far more consistent results. The new approach also allows the 'ancestor' class to be attributed to menu items where the link_url
looks like an ancestor of the current request URL. For example, if a menu item's link_url
value is '/news/'
, and the request path is '/news/boring-news-article/'
, then the menu item will be attributed with the 'ancestor' class.
The previous behaviour is now deprecated in favour of this new approach, and will be removed in version 2.10, with the new approach becoming the default (and only) option.
Minor changes & bug fixes
- Various documentation spelling/formatting corrections (thanks to Sergey Fedoseev and Pierre Manceaux).
Deprecations
- The current 'active class' attribution behaviour for menu items linking to custom URLs is deprecated (see above for details). Add
WAGTAILMENUS_CUSTOM_URL_SMART_ACTIVE_CLASSES = True
to your project's settings to enable the new and improved behaviour and silence the deprecation warning.
Upgrade considerations
Following the standard deprecation period, the following classes, methods and
behaviour has been removed:
- Wagtailmenus now unconditionally uses backend-specific templates for rendering, and the
WAGTAILMENUS_USE_BACKEND_SPECIFIC_TEMPLATES
setting is ignored completely. See the 2.6 release notes for more info: http://wagtailmenus.readthedocs.io/en/stable/releases/2.6.0.html#improved-compatibility-with-alternative-template-backends. - The
get_template_engine()
method has been removed fromwagtailmenus.models.menus.Menu
. - The
panels
attribute has been removed from theAbstractMainMenu
andAbstractFlatMenu
models, as have themain_menu_panels
andflat_menu_panels
panel definition values fromwagtailmenus.panels
.
v2.7.1
This is a maintenence release to fix a bug that was resulting in content_panels
and setting_panels
being ignored by Wagtail’s editing UI when editing main or flat menus.
There have also been a few minor tweaks to the documentation, including:
- Removing the ‘alpha’ notice and title notation from the 2.7.0 release notes.
- Adding a badge to README.rst to indicate the documentation build status.
- Adding a missing ‘migrate’ step to the Developing locally instructions in the contribution guidelines.
- Updating the code block in the .po to .mo conversion step in the packaging guidelines to the
find
command withexecdir
.