Skip to content

v1.6.0

Compare
Choose a tag to compare
@ababic ababic released this 27 Oct 16:40
· 901 commits to master since this release

What's changed?

  • Improved confirmation messages when saving a menu in the admin area.
  • Added a new test to submit the MainMenu edit 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_processor to handle some of the logic that was
    previously being done in template tags. Django's SimpleLazyObject class 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_PATH setting to allow
    developers to disable the 'guess tree position from path' functionality
    that comes into play when serving custom views, where the before_serve_page
    hook isn't activated, and wagtailmenu_params_helper() in wagtail_hooks.py
    doesn'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.py to 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_CHOICES setting that, if
    set, will turn the CharField used for FlatMenu.handle in add/edit/copy
    forms into a ChoiceField, with that setting as the available choices.

Upgrade Considerations

Adding the context_processor to settings

Wagtailmenus now requires a context_processor to be active in order for menu tags to work. If upgrading to version 1.6.0, you'll need to update the TEMPLATES setting to include the new context_processor, like so:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(PROJECT_ROOT, 'templates'),
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.debug',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.request',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django.contrib.messages.context_processors.messages',
                'wagtail.contrib.settings.context_processors.settings',
                'wagtailmenus.context_processors.wagtailmenus',
            ],
        },
    },
]