Unreleased
Fix TypeError when using Wagtail 7.3 with Django < 6.0
- Fix TypeError with Django 6.0+ #522.
- Add testing for Django 6.0
- Add testing for Wagtail 7.2
- Add testing for Python 3.14
- Add testing for Wagtail 7.1
- Removed support for Python 3.9
- Removed support for Wagtail 6.4
- Fix Pypi Project links are broken, Read the Docs not updated #488
- Update testing environment for Wagtail 6.4
- Update testing environment for Wagtail 7.0
- Removed support for Wagtail <6.3.
- Removed support for Django 5.0.
- Update the testing environment to test Wagtail 6.3 and Django 5.1
- Add conditional support for Wagtail 6.3 templates.
- Fix Italian translation #499.
- Fix German translation.
- Fix
bs4.FeatureNotFounderror on tests.
- 🐛 FIX: Versions on docs index by @MrCordeiro in #455
- Support/wagtail-50 by @katdom13 in #457
- Fix/settings panel append by @benfroelich in #441
- add indonesian translation by @kiraware in #458
- Independent wagtail_modeladmin support for Wagtail 5.1 by @dkirkham in #461
- Release prep/3.1.9 by @MrCordeiro in #462
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #463
- Wagtail 5.2 by @katdom13 in #465
- Add Ukrainian translation by @yarickprih in #466
- Dutch translation by @MaartenUreel in #469
- Upgrade GitHub Actions by @cclauss in #473
- 💥BREAKING: Migrate from ModelAdmin to Snippets by @dkirkham in #472
- 👷: update gh actions by @schlich in #477
- 👷: update set-output command by @schlich in #478
- Update package and testing configurations by @dkirkham in #481
- ModelAdmin to Snippets Documentation Update by @dkirkham in #483
- Rename admin module by @dkirkham in #482
- 🔒: add bandit code scanner by @schlich in #479
- Fix #445 which caused discrepancy between compatibility on website and readme.
- Fix 460 by replacing
wagtail.contrib.modeladminwithwagtail_modeladmin. - Update testing for Wagtail 5.0 and Django 4.2.
- Dropped support for Python 3.7.
- Fix bug that prevented the
show_menu_headingfrom working on default flat menus. - Fix
autopopulate_main_menusinstructions. - Fix docs examples for registering hooks.
- Fix #435 and #452, which were causing extra migrations on the id fields.
- This is a dummy release to fix the publishing of the 3.1.6 release on PyPI.
- Add "Python 3.11" to the list of PyPI classifiers.
- This is a dummy release to fix the publishing of the 3.1.4 release on PyPI.
- Update testing for Wagtail 4.1 and 4.2
- Tidy up imports and remove unused imports
- Silence DEFAULT_AUTO_FIELD warnings in tests
- Added support for Wagtail 4.0.
- Added support for Django 4.1.
- Updated travis/tox test settings to test against Wagtail 4.0 and Django 4.1.
- Added support for Wagtail >3.0.
- Updated Travis/tox test settings to test against Wagtail 3.0.
- Fix: #421, which prevented creating or editing menus in wagtail 3.0.
- Removed support for Wagtail <2.15.
- Removed support for Django <3.2.
- Added support for Wagtail 2.15.
- Added support for Wagtail 2.16.
- Added support for Django 4.0.
- Added support for Wagtail 2.10 (no code changes necessary).
- Updated menu classes to better support cases where 'request' and 'site' are not available in the context.
- Transfered project to Jazzband.
- Removed project from Transifex.
- Added support for Wagtail 2.9 (no code changes necessary) (Sekani Tembo).
- Added compatibility with Django Sites Framework (Sekani Tembo).
- Various documentation updates.
- Added support for Django 3.0 and Wagtail 2.8 (thanks to Arkadiusz Michał Ryś).
- Always fetch/use specific page data when rendering menus (see release notes for more details).
- Optimised 'derive page from URL' and 'derive section root' logic
- Added support for Django 2.2 (no code changes necessary).
- Added support for Wagtail 2.5 (no code changes necessary).
- Added support for Wagtail 2.6 (no code changes necessary).
- Added support for Wagtail 2.7.
- Added support for Python 3.8.
- Removed support for
get_sub_menu_templates()methods that do not accept a level argument. - Removed recommendation / automatic integration for
wagtail-condensedinlinepanel. - Fix: #329, which prevented level-specific template naming from working as specified in the docs.
- Fix: #323, which prevented
StreamFieldfrom working properly when creating or editing menus with custom item models.
- Fix: #329, which prevented level-specific template naming from working as specified in the docs.
- Fix: #323, which prevented
StreamFieldfrom working properly when creating or editing menus with custom item models.
- Dropped support for
relative_url()methods on custom menu item models that do not support arequestkeyword argument. - Added support for Wagtail 2.4.
- Added support for Wagtail 2.3.
- Added support for Django 2.1.
- Minor documentation updates (OktayAltay).
- Updated
MenuPage.get_repeated_menu_item()to nullifysub_menuon the copy to reduce likelihood of infinite recursion errors. - Updated
Menu._prime_menu_item()to setsub_menuto None if no new value is being added, to reduce likelihood of infinite recursion errors. - Updated
SectionMenu.prepare_to_render()to augmentroot_pagewithtext,hrefandactive_classattributes, so that it no longer has to be done inSectionMenu.get_context_data(). - Updated
AbstractLinkPage.get_sitemap_urls()signature to match Wagtail 2.2 (Dan Bentley). - Documentation typo correction and other improvements (DanAtShenTech).
- Fix an issue where the
WAGTAILMENUS_USE_CONDENSEDINLINEPANELsetting wasn't being respected.
- Fix: #329, which prevented level-specific template naming from working as specified in the docs.
- Fix: #323, which prevented
StreamFieldfrom working properly when creating or editing menus with custom item models.
- Changed the signature of
Menu.render_from_tag()to better indicate common expected/supported arguments for menus. - Added a custom
render_from_tag()method for each individual menu class, with a signature that highlights all relevant options, including those specific to that menu type. - Renamed
Menu.get_contextual_vals_from_context()toMenu._create_contextualvals_obj_from_context()to give a better indication of what the method does. - Renamed
Menu.get_option_vals_from_optionstoMenu._create_optionvals_obj_from_values()to give a better indication of what the method does. - Added the
Menu.get_from_collected_values()method, which replacesMenu.get_instance_for_rendering()for menu classes that also inherit fromdjango.db.models.Model. - Added the
Menu.create_from_collected_values()method, which replacesMenu.get_instance_for_rendering()for menu classes that do not inherit fromdjango.db.models.Model. - Added the
add_sub_menu_items_inlineoption to all template tags. WhenTrue,SubMenuobjects are automatically created and set as an attribute for each menu item (where appropriate), allowing developers to render multi-level menus without having to use the{% sub_menu %}tag. - Added the
WAGTAILMENUS_DEFAULT_ADD_SUB_MENUS_INLINEsetting to allow developers to change the defaultadd_sub_menu_items_inlineoption value for all template tags. - Fixed a bug in
Menu.get_common_hook_kwargs()where the value ofself.max_levelswas being used as the value foruse_specific(instead ofself.use_specific). - Changed the "Rendering setings" (typo) heading in
panels.menu_settings_panelsto "Render settings". - Removed support for the deprecated
WAGTAILMENUS_CHILDREN_MENU_CLASS_PATHsetting. - Removed support for the deprecated
WAGTAILMENUS_SECTION_MENU_CLASS_PATHsetting. - Removed the deprecated
wagtailmenus.constantsmodule.
- Fixed an issue with the section menu in the release notes section of the docs.
- Updated tox config to test against Python 3.7 and Wagtail 2.2.
- Updated Travis CI config to deploy to PyPi automatically when commits are tagged appropriately.
- Pinned django-cogwheels dependency to version 0.2 to reduce potential for backwards-incompatibility issues.
- Added support for Wagtail version 2.1.
- Dropped support for Wagtail versions 1.10 to 1.13.
- Dropped support for Django versions 1.8 to 1.10.
- Updated trove classifiers in
setup.pyto reflect Django and Wagtail version support. - Updated
runtests.pyto pass on any unparsed option arguments to Django's test method. - Updated
runtests.pyto filter out deprecation warnings originating from other apps by default. - Updated
MenuItem.relative_url()to accept arequestparameter (for parity withwagtail.core.models.Page.relative_url()), so that it can pass it on to the page method. - Updated
Menu.prime_menu_items()to send the currentHttpRequestto thatMenuItem.relative_url()andPage.relative_url(). - Updated admin views to utilise
wagtail.admin.messages.validation_error()for reporting field-specific and non-field errors. - Removed redundant
install_requiresline fromsetup.py. Compatibility is made clear in other places - there's no need to force a minimum installed Wagtail version here. - Moved custom
wagtail.contrib.modeladminclasses out ofwagtailmenus.wagtail_hooksand into a newwagtailmenus.modeladminmodule. - Added the
WAGTAILMENUS_FLAT_MENUS_MODELADMIN_CLASSsetting to allow the defaultModelAdminclass used to enable flat menu editing in the Wagtail admin area to be swapped out for a custom one. - Added the
WAGTAILMENUS_MAIN_MENUS_MODELADMIN_CLASSsetting to allow the defaultModelAdminclass used to enable main menu editing in the Wagtail admin area to be swapped out for a custom one. - Replaced custom app settings module with
django-cogwheelsand removed a lot of the tests that existed to test its workings. - Moved remaining app settings tests to
wagtailmenus.conf.tests.
- Fix: #329, which prevented level-specific template naming from working as specified in the docs.
- Optimised MenuWithMenuItems.get_top_level_items() and AbstractFlatMenu.get_for_site() to use fewer database queries to render menus.
- Configured
sphinxcontrib.spellingand used to correct spelling errors in docs. - Updated testing and documentation dependencies.
- Moved
wagtailmenus.constantsandwagtailmenus.app_settingsinto a newwagtailmenus.confapp - Refactored the app settings module to be DRYer and more generic
- Remove
FLAT_MENU_MODEL_CLASSandMAIN_MENU_MODEL_CLASSapp settings attributes in favour of using the app settings module'sget_model()method to return Django models when needed. - Deprecated the
WAGTAILMENUS_CHILDREN_MENU_CLASS_PATHsetting in favour of using justWAGTAILMENUS_CHILDREN_MENU_CLASS. - Deprecated the
WAGTAILMENUS_SECTION_MENU_CLASS_PATHsetting in favour of using justWAGTAILMENUS_SECTION_MENU_CLASS. - Added Latin American Spanish translations (thanks to José Luis).
- Added
WAGTAILMENUS_MAIN_MENUS_EDITABLE_IN_WAGTAILADMINsetting to the 'Main menu' menu item and underlying management functionality to be removed from the Wagtail admin area (thanks to Michael van de Waeter). - Added
WAGTAILMENUS_FLAT_MENUS_EDITABLE_IN_WAGTAILADMINsetting to the 'Flat menus' menu item and underlying management functionality to be removed from the Wagtail admin area (thanks to Michael van de Waeter). - Added the 'sub_menu_templates' option to menu tags to allow sub menu templates to be specified for each level.
- Updated 'get_template_names()' and 'get_sub_menu_template_names()' methods for each class to search for template paths including the level currently being rendered, allowing developers to define level-specific templates in their templates directory, and have wagtailmenus find and use them automatically.
- Added improved active class attribution behaviour for menu items that link to custom URLs (Enabled using the
WAGTAILMENUS_CUSTOM_URL_SMART_ACTIVE_CLASSESsetting). - Deprecated the existing active class attribution behaviour in favour of the above.
- Backend-specific template instances are now always used for rendering.
- Removed
get_template_engine()method fromwagtailmenus.models.menus.Menu - Removed
panelsattributes from theAbstractMainMenuandAbstractFlatMenumodels - Removed
main_menu_panelsandflat_menu_panelsfromwagtailmenus.panels. - Various documentation spelling/formatting corrections (thanks to Sergey Fedoseev and Pierre Manceaux).
- Fixed a bug in MenuTabbedInterfaceMixin preventing
content_panelsandsettings_panelsbeing picked up in the editing UI when using Wagtail 2.0. - Remove the 'alpha' notice and title notation from the 2.7.0 release notes.
- Added a badge to README.rst to indicate the documentation build status.
- Added a missing 'migrate' step to the Developing locally instructions in the contribution guidelines.
- Updated the code block in the .po to .mo conversion step in the packaging guidelines to the
findcommand withexecdir.
- Added support for Wagtail 2.0 and Django 2.0
- Dropped support for Python 2 and 3.3.
- Dropped support for Wagtail versions 1.8 to 1.9
- Dropped support for Django versions 1.5 to 1.9
- Made numerous 'Python 3 only' optimisations to code.
- The
wagtailmenus.models.menus.MenuFromRootPageclass was removed. - The
__init__()method ofwagtailmenus.models.menus.ChildrenMenuno longer accepts a root_page keyword argument. The parent page should be passed using the parent_page keyword instead. - The root_page attribute has been removed from the
wagtailmenus.models.menus.ChildrenMenuclass. Use the parent_page attribute instead. - The
sub_menutemplate tag no longer accepts a stop_at_this_level keyword argument. - The
get_sub_menu_items_for_page()andprime_menu_items()methods have been removed fromwagtailmenus.templatetags.menu_tags. - The
get_attrs_from_context()method has been removed fromwagtailmenus.utils.misc. - The
get_template_names()andget_sub_menu_template_names()methods have been removed fromwagtailmenus.utils.templateand the redundantwagtailmenus.utils.templatemodule removed. - Fixed an issue that was preventing translated field label text appearing for
the
handlefield when using theFLAT_MENUS_HANDLE_CHOICESsetting (Contributed by @jeromelebleu)
- Improve compatibility with alternative template backends such as
jinja2. Implementation by @hongquan. - Added compatibility with
wagtail-condensedinlinepanel. - Updated the menu CMS editing UI to split rendering setting field out into their own tab.
- Updated tests to test compatibility with Wagtail 1.13.
- Fixed a bug that was causing Django to create new migrations for wagtailmenus
after changing Django's
LANGUAGE_CODEsetting for a project. Thanks to @philippbosch from A Color Bright for the fix.
- Added rendering logic to Menu classes and refactored all existing template tags to make use of it (massively reducing code duplication in menu_tags.py).
- Added support for several 'hooks', allowing for easier customisation of base querysets and manipulation of menu items during rendering. For more information and examples, see the 'Hooks' section of the documentation: http://wagtailmenus.readthedocs.io/en/latest/advanced_topics/hooks.html
- Updated the 'sub_menu' tag to raise an error if used in a way that isn't supported.
- Deprecated
get_sub_menu_items_for_pageandprime_menu_itemsmethods fromwagtailmenus.templatetags.menu_tags(logic moved to menu classes). - Deprecated
get_templateandget_sub_menu_template_namesmethods fromwagtailmenus.utils.template(logic moved to menu classes). - Deprecated
get_attrs_from_contextmethod fromwagtailmenus.utils.misc(logic moved to menu classes). - Deprecated the
MenuFromRootPageclass fromwagtailmenus.models.menusin favour of using a newMenuFromPageclass that fits better with how it's used in menu classes. - Minor tidying / renaming of tests.
- Added a 'add_menu_items_for_pages()' method to the
MenuWithMenuItemsmodel, which adds menu item to a menu object, linking to any pages passed in as aPageQuerySet. - Added the 'autopopulate_main_menus' command, that can be run as part of the installation process to help populate main menus based on the 'home' and 'section root' pages for each site.
- Fixed an issue with runtests.py that was causing tox builds in Travis CI to report as successful, even when tests were failing. Contributed by Oliver Bestwalter (obestwalter).
- Deprecated the
stop_at_this_levelargument for thesub_menutag, which hasn't worked for a few versions. - Added support for Wagtail 1.12.
- Made the logic in menu classes 'page_children_dict' method easier to override by moving it out into a separate 'get_page_children_dict()' method, which the original (@cached_property decorated) method calls.
- Made the logic in menu classes 'pages_for_display' method easier to override by moving it out into a separate 'get_pages_for_display()' method, which the original (@cached_property decorated) method calls.
- Made the logic in menu classes 'top_level_items' method easier to override by moving it out into a separate 'get_top_level_items()' method, which the original (@cached_property decorated) method calls.
- Adjusted Meta classes on menu item models so that common behaviour is defined once in AbastractMenuItem.Meta.
- Refactored the AbstractMenuItem's
menu_textproperty method to improve code readability, and better handle instances where neither link_text or link_page are set. - Replaced overly long README.md with brand new documentation and a new README.rst which will render better on PyPi. The documentation is kindly hosted by readthedocs.org and can be found at http://wagtailmenus.readthedocs.io/
- Added Chinese translations, kindly submitted by 汇民 王 (levinewong)
- Added the 'use_absolute_page_urls' argument to all template tags. When a
value equating to
Trueis provided, the menu will be rendered using the 'full URL' for each page (including the protocol/domain derived from the relevantwagtailcore.models.Siteobject), instead the 'relative URL' used by default. Developed by Trent Holliday of Morris Technology and Andy Babic.
- Fixed a bug that would result in {% sub_menu %} being called recursively ( until raising a "maximum recursion depth exceeded" exception) if a 'repeated menu item' was added at anything past the 2nd level. Thanks to @pyMan for raising/investigating.
- Code example formatting fixes, and better use of headings in README.md.
- Added 'on_delete=models.CASCADE' to all relationship fields on models where no 'on_delete' behaviour was previously set (Django 2.0 compatibility).
- Marked a missing string for translation (@einsfr).
- Updated translations for Lithuanian, Portuguese (Brazil), and Russian. Many thanks to @mamorim, @matas.dailyda and @einsfr!
- Added an 'AbstractLinkPage' model to wagtailmenus.models that can be easily sub-classed and used in projects to create 'link pages' that act in a similar fashion to menu items when appearing in menus, but can be placed in any part of the page tree.
- Updated 'modify_submenu_items', 'has_submenu_items' and
'get_repeated_menu_item' methods on MenuPageMixin / MenuPage to accept a
'request' parameter, which is used to pass in the current
HttpRequestobject the menu is being rendered for. - Added the
WAGTAILMENUS_SECTION_MENU_CLASS_PATHsetting, which can be used to override theMenuclass used when using the{% section_menu %}tag. - Added the
WAGTAILMENUS_CHILDREN_MENU_CLASS_PATHsetting, which can be used to override theMenuclass used when using the{% children_menu %}tag. - All
Menuclasses are now 'request aware', meaningself.requestwill return the currentHttpRequestobject within most methods. - Added a
get_base_page_queryset()method to allMenuclasses, that can be overridden to change the base page QuerySet used when identifying pages to be included in a menu when rendering. For example developers could useself.request.userto only ever include pages that the current user has some permission for. - Abstracted out most model functionality from
MenuPageto aMenuPageMixinmodel, that can be used with existing page type models. - Added wagtail 1.10 and django 1.11 test environments to tox.
- Renamed
test_frontend.pytotest_menu_rendering.py - In situations where
request.sitehasn't been set by wagtail'sSiteMiddleware, the wagtailmenus context processor use the default site to generate menus with. - Updated AbstractMenuItem.clean() to only ever return field-specific
validation errors, because Wagtail doesn't render non-field errors for
related models added to the editor interface using
InlinePanel. - Added Russian translations (submitted by Alex einsfr).
- Fixed a bug that would result in {% sub_menu %} being called recursively ( until raising a "maximum recursion depth exceeded" exception) if a 'repeated menu item' was added at anything past the 2nd level. Thanks to @pyMan for raising/investigating.
- Got project set up in Transifex.
- Updated translatable strings throughout the project to use named variable substitution, and unmarked a few exception messages.
- Add Lithuanian translations (submitted by Matas Dailyda).
- Better handle situations where
requestisn't available in the context, orrequest.sitehasn't been set.
- Updated travis/tox test settings to test against Wagtail 1.9 & Django 1.10.
- Removed a couple of less useful travis/tox environment tests to help with test speed.
- Made use of 'extras_require' in setup.py to replace multiple requirements files.
- Optimised the app_settings module so that we can ditch the questionably stuff we're doing with global value manipulation on app load (solution inspired by django-allauth).
- Added new symantic version handling to the project (solution inspired by wagtail)
- Utilise Django's 'django.template.loader.select_template()' method
to provide a more intuitive way for developers to override templates for
specific menus without having to explicitly specify alternative templates
via settings or via the
templateandsub_menu_templateoptions for each menu tag. See the updated documentation for each tag for information about where wagtailmenus looks for templates. - Added the
WAGTAILMENUS_SITE_SPECIFIC_TEMPLATE_DIRSsetting to allow developers to choose to have wagtailmenus look in additional site-specific locations for templates to render menus. - Moved some methods out of
template_tags/menu_tags.pyinto a newutils.pyfile to makemenu_tags.pyeasier to read / maintain in future. - Brazilian Portuguese language translations added by @MaxKurama.
- Added try/except to
AbstractMenuItem.relative_url()so that errors aren't thrown whenPage.relative_urlreturnsNonefor some reason.
- Fixed a bug that would result in {% sub_menu %} being called recursively ( until raising a "maximum recursion depth exceeded" exception) if a 'repeated menu item' was added at anything past the 2nd level. Thanks to @pyMan for raising/investigating.
- Fixed a bug in the
section_menutag when attempting to apply the correct active class tosection_rootwhen themodify_submenu_items()method has been overridden to return additional items without anactive_classattribute (like in the example code in README).
- Fixed a bug preventing reordered menu items from retaining their new order
after saving. The Meta class on the new abstract models had knocked out the
sort_orderordering fromwagtail.wagtailcore.models.Orderable.
- Fixed import error on pip install from version 2.1.0 (Adriaan Tijsseling)
- Added official support for wagtail v1.8.
- Turned
wagtailmenus.app_settingsinto a real settings module. - Added
WAGTAILMENUS_MAIN_MENU_MODELandWAGTAILMENUS_FLAT_MENU_MODELsettings to allow the default main and flat menu models to be swapped out for custom models. - Added
WAGTAILMENUS_MAIN_MENU_ITEMS_RELATED_NAMEandWAGTAILMENUS_FLAT_MENU_ITEMS_RELATED_NAMEsettings to allow the default menu item models to be swapped out for custom models. - Added the
WAGTAILMENUS_PAGE_FIELD_FOR_MENU_ITEM_TEXTsetting to allow developers to specify a page attribute other thantitleto be used to populate thetextattribute for menu items linking to pages. - Added german translation by Pierre (@bloodywing).
- Split models.py into 3 logically-named files to make models easier to find.
Fixed migration related issue raised by @urlsangel.
This release is broken and shouldn't be used. Skip to v2.0.3 instead.
Bug fix for main_menu template tag.
- The
use_specificmenu tag argument can now be one of 4 integer values, allowing for more fine-grained control over the use ofPage.specificandPageQuerySet.specific()when rendering menu tags (see README.md for further details). MainMenuandFlatMenumodels now have ause_specificfield, to allow the defaultuse_specificsetting when rendering that menu to be changed via the admin area.MainMenuandFlatMenumodels now have amax_levelsfield, to allow the defaultmax_levelssetting when rendering that menu to be changed via the admin area.- When rendering a multi-level
MainMenuor `FlatMenu, the model instances for those menus pre-fetch all of pages needed to generate the entire menu. The menu tags then request lists of child pages from menu instance as they are needed, reducing the need to hit the database at every single branch. - The
max_levels,use_specific,parent_pageandmenuitem_or_pagearguments passed to all template tags are now checked to ensure their values are valid, and if not, raise aValueErrorwith a helpful message to aid debugging. - Developers not using the
MenuPageclass or overriding any of wagtailPagemethods involved in URL generation can now enjoy better performance by choosing not to fetch any specific pages at all during rendering. Simply passuse_specific=USE_SPECIFIC_OFForuse_specific=0to the tag, or update theuse_specificfield value on yourMainMenuorFlatMenuinstances via the Wagtail admin area. - Dropped support for the
WAGTAILMENUS_DEFAULT_MAIN_MENU_MAX_LEVELSandWAGTAILMENUS_DEFAULT_FLAT_MENU_MAX_LEVELSsettings. Default values are now set using themax_levelsfield on the menu objects themselves. - Dropped support for the
WAGTAILMENUS_DEFAULT_MAIN_MENU_USE_SPECIFICandWAGTAILMENUS_DEFAULT_FLAT_MENU_USE_SPECFICsettings. Default values are now set using theuse_specificfield on the menu objects themselves. - Eliminated a lot of code duplication in template tags by adding the
get_sub_menu_items_for_pagemethod, which is used bysub_menu,section_menuandchildren_menuto do most of their work. - The default
show_multiple_levelsvalue for theflat_menutag is nowTrueinstead ofFalse. The defaultmax_levelsfield value forFlatMenuinstances is1, which has the same effect. Only, the value can be changed via the admin area, and the changes will reflected immediately without having to explicitly addshow_multiple_levels=Trueto the tag in templates. - The
has_submenu_items()method onMenuPageno longer accepts acheck_for_childrenargument. - The
modify_submenu_items()andhas_submenu_items()methods on theMenuPagemodel now both accept an optionalmenu_instancevalue, so that menu_instance might be called to access pre-fetched page data without hitting the database. - Added the
WAGTAILMENUS_ADD_EDITOR_OVERRIDE_STYLESsetting to allow override styles to be disabled. - Other minor performance improvements.
- French translations added by François GUÉRIN (frague59)
- Improved confirmation messages when saving a menu in the admin area.
- Added a new test to submit the
MainMenuedit form and check that it behaves as expected. - Added some styles to menu add/edit/copy views to improve the UI.
- Added a new
context_processorto handle some of the logic that was previously being done in template tags. Django'sSimpleLazyObjectclass is used to reduce the overhead as much as possible, only doing the work when the values are accessed by menu tags. - Added the
WAGTAILMENUS_GUESS_TREE_POSITION_FROM_PATHsetting to allow developers to disable the 'guess tree position from path' functionality that comes into play when serving custom views, where thebefore_serve_pagehook isn't activated, andwagtailmenu_params_helper()inwagtail_hooks.pydoesn't get to add it's helpful values to the request/context. - Updated tox environment settings to run tests against wagtail==1.7, and
updated pinned wagtail version in
setup.pyto reflect compatibility. - Added unicode support for python 2.7 and added missing verbose_names to fields so that they can be translated (Alexey Krasnov & Andy Babic).
- Added support for a
WAGTAILMENUS_FLAT_MENUS_HANDLE_CHOICESsetting that, if set, will turn theCharFieldused for FlatMenu.handle in add/edit/copy forms into aChoiceField, with that setting as the available choices.
MenuPage.has_submenu_items()is now only ever called ifcheck_for_childrenis True inmenu_tags.prime_menu_items(). This way, themax_levelsvalue supplied to the original menu tag is always respected, with no additional levels ever being rendered. Thecheck_for_chilrenvalue passed tohas_submenu_items()is now always True. Since removing would add breaking changes, it will be removed in a later feature release.- Fixed a migration-related issue that was Django to create new migrations for the app.
- Fixed an issue where not all help text was marked for translation.
- Updated FlatMenu listing in CMS to only show site column and filters if menus are defined for more than one site.
- Added the
fall_back_to_default_site_menusoption to theflat_menutag, to allow flat menus defined for the default site to be used as fall-backs, in cases where the 'current' site doesn't have its own menus set up with the specified handle. - Added a custom ValidationError to FlatMenu's
clean()method that better handles theunique_togetherrule that applied tositeandhandlefields. - Added the ability to copy/duplicate existing FlatMenu objects between sites (or to the same site with a different handle) via Wagtail's admin area. The 'Copy' button appears in the listing for anyone with 'add' permission, and the view allows the user to make changes before anything is saved.
- Apply
activeclasses to menu items that link to custom URLs (ifrequest.pathandlink_urlare exact matches). - Added a
handletoMenuItemmodel to provide a string which can be used to do specific matching of menu items in the template. (Tim Leguijt)
- Updated FlatMenu listing in CMS to include a column for
site, a filter forhandle, and a MenuItem count for each object. Also added default ordering, and output the handle value in a<code></code>tag to make it stand out. - Made it easier to develop and debug wagtailmenus locally, by running it as a Django project. See CONTRIBUTING.md for instructions.
- Added a
get_for_siteclass method to the FlatMenu model, to be consistent with the MainMenu model, and renamed thefor_sitemethod on MainMenu toget_for_sitefor consistency.main_menuandflat_menutags now make use of these. - Fixed an minor bug in the
prime_menu_itemsmethod, where adepthvalue was hard-coded, instead of utilising theSECTION_ROOT_LEVELsetting.
- Added a
has_submenu_items()method toMenuPagemodel to complimentmodify_submenu_items()in version 1.3. Allows for far better control and consistency when overridingmodify_submenu_items()to add additional menu items for specific page types. - Added a
sub_menu_templateoption tomain_menu,section_menu,flat_menuandchildren_menuthat will be automatically picked up by thesub_menutag and used as the template (if notemplatevalue is provided). - Added a
fetch_specific_pagesoption to all template tags, that if True, will used PageQuerySet'sspecific()method to return instances of the most specific page-type model as menu items, instead of just vanillaPageobjects. - Added settings to allow default
fetch_specific_pagesvalue to be altered for each individual menu tag. - If
fetch_specific_pagesis True,prime_menu_itemswill call therelative_urlmethod on the specific page to determine a menu item'shrefvalue, meaning overrides to that method will be respected.
- Configured additional tox test environments for Wagtail>=1.6 with Django=1.9 and 1.10.
- Extended the 'section matching by path' functionality added in 1.3.0 to also identify a 'current page' if the found page matches the exact path.
- Added further tests for path matching.
- Reduced the number of unnecessary calls to
Page.specificinmenu_tags.pywhere possible.
- Added the ability for all menu tags to (attempt to) identify ancestor pages
and section root page by using components from the request path when serving
a custom URL (not routed via the page tree / served by
wagtail_serve) - Added
modify_submenu_items()method toMenuPagemodel, which takes responsibility for modifying the initial menu_items list insection_menuandsub_menutags. A DRYer approach, that is easier to extend/override to meet custom needs.
- Added PyPi version and coveralls test coverage badges to README
- Altered Travis CI test configuration to use tox, allowing for much better control over test environments
- Added tests for Python 3.4 and 3.5 to confirm compatibility
- Added CONTRIBUTORS.rst
- Added this changelog :)
- Added
WAGTAILMENUS_SECTION_ROOT_DEPTHsetting support, for more consistent identification of 'section root' pages