---
local:
depth: 1
---
Here are other changes related to the redesign:
The panel types StreamFieldPanel
, RichTextFieldPanel
, ImageChooserPanel
, DocumentChooserPanel
and SnippetChooserPanel
have been phased out, and can now be replaced with FieldPanel
. Additionally, PageChooserPanel
is only required when passing a page_type
or can_choose_root
, and can otherwise be replaced with FieldPanel
. In all cases, FieldPanel
will now automatically select the most appropriate form element. This feature was developed by Matt Westcott.
FieldPanel
now accepts a permission
keyword argument to specify that the field should only be available to users with a given permission level. This feature was developed by Matt Westcott and sponsored by Google as part of Wagtail's page editor redevelopment.
With every Wagtail Page you are able to add a helpful description text, similar to a help_text
model attribute. By adding page_description
to your Page model you'll be adding a short description that can be seen in different places within Wagtail:
class LandingPage(Page):
page_description = "Use this page for converting users"
content_json
TextField
with content
JSONField
in PageRevision
(Sage Abdullah)replace_text
management command (Sage Abdullah)data_json
TextField
with data
JSONField
in BaseLogEntry
(Sage Abdullah):focus-visible
for cross-browser consistency (Paarth Agarwal)modelAdmin
(Serafeim Papastefanos)README.md
logo to work for GitHub dark mode (Paarth Agarwal)If-Modified-Since
header in sendfile_streaming_backend
which was only used by IE (Mariusz Felisiak)StreamField
to use JSONField
to store data, rather than TextField
(Sage Abdullah)simple_translations
ensure that the user is redirected to the page edit view when submitting for a single locale (Mitchel Cabuloy)Form
pages, ensure that all added fields are correctly shown in the preview (Joshua Munn)WAGTAILDOCS_CONTENT_TYPES
& WAGTAILDOCS_INLINE_CONTENT_TYPES
ensure that the filename is correctly set in the Content-Disposition
header so that saving the files will use the correct filename (John-Scott Atlakson)aria-haspopup="menu"
for all sidebar menu items that have sub-menus (LB (Ben Johnston))aria-expanded
is always explicitly set as a string in sidebar (LB (Ben Johnston))role="main"
attributes on <main>
elements causing HTML validation issues (Luis Espinoza)Various modules of Wagtail have been reorganised, and imports should be updated as follows:
wagtail.core
can now be found under wagtail
- for example, from wagtail.core.models import Page
should be changed to from wagtail.models import Page
wagtail.tests
module is renamed to wagtail.test
wagtail.admin.edit_handlers
is renamed to wagtail.admin.panels
wagtail.contrib.forms.edit_handlers
is renamed to wagtail.contrib.forms.panels
These changes can be applied automatically to your project codebase by running the following commands from the project root:
wagtail updatemodulepaths --list # list the files to be changed without updating them
wagtail updatemodulepaths --diff # show the changes to be made, without updating files
wagtail updatemodulepaths # actually update the files
IE mode <https://docs.microsoft.com/en-us/deployedge/edge-ie-mode>
_ to keep access to IE11-only sites, while other sites and apps like Wagtail can leverage modern browser capabilities.content_json
TextField
with content
JSONField
in PageRevision
content_json
field in the PageRevision
model has been renamed to content
.JSONField
instead of TextField
.PageRevision
objects, running the migrations might take a while.data_json
TextField
with data
JSONField
in BaseLogEntry
data_json
field in the BaseLogEntry
model has been renamed to data
.JSONField
instead of TextField
.""
to {}
.BaseLogEntry
subclasses, i.e. PageLogEntry
and ModelLogEntry
.window.registerHalloPlugin
will no longer be created on the page editor load, unless the legacy package is installed.Various changes have been made to the internal API for defining panel types, previously known as edit handlers. As noted above, the module wagtail.admin.edit_handlers
has been renamed to wagtail.admin.panels
, and wagtail.contrib.forms.edit_handlers
is renamed to wagtail.contrib.forms.panels
.
Additionally, the base wagtail.admin.edit_handlers.EditHandler
class has been renamed to wagtail.admin.panels.Panel
, and wagtail.admin.edit_handlers.BaseCompositeEditHandler
has been renamed to wagtail.admin.panels.PanelGroup
.
Template paths have also been renamed accordingly - templates previously within wagtailadmin/edit_handlers/
are now located under wagtailadmin/panels/
, and wagtailforms/edit_handlers/form_responses_panel.html
is now at wagtailforms/panels/form_responses_panel.html
.
Where possible, third-party packages that implement their own field panel types should be updated to allow using a plain FieldPanel
instead, in line with Wagtail dropping its own special-purpose field panel types such as StreamFieldPanel
and ImageChooserPanel
. The steps for doing this will depend on the package's functionality, but in general:
Widget
class that produces your desired HTML rendering.widget_overrides
method, your code should instead call register_form_field_override
so that the desired widget is always selected for the relevant model field type.get_comparison_class
method, your code should instead call wagtail.admin.compare.register_comparison_class
to register the comparison class against the relevant model field type.Within the Panel
class, the methods widget_overrides
, required_fields
and required_formsets
have been deprecated in favour of a new get_form_options
method that returns a dict of configuration options to be passed on to the generated form class:
required_fields
should instead return this value as a fields
item in the dict returned from get_form_options
required_formsets
should instead return this value as a formsets
item in the dict returned from get_form_options
widget_overrides
should instead return this value as a widgets
item in the dict returned from get_form_options
The template context for panels derived from BaseChooserPanel
has changed. BaseChooserPanel
is deprecated and now functionally identical to FieldPanel
; as a result, the context variable is_chosen
, and the variable name given by the panel's object_type_name
property, are no longer available on the template. The only available variables are now field
and show_add_comment_button
. If your template depends on these additional variables, you will need to pass them explicitly by overriding the render_as_field
method.
WagtailAdminModelForm
When overriding the get_form_class
method of a ModelAdmin CreateView
or EditView
to pass a custom form class, that form class must now inherit from wagtail.admin.forms.models.WagtailAdminModelForm
. Passing a plain Django ModelForm subclass is no longer valid.
size
argument of the undocumented wagtail.utils.sendfile_streaming_backend.was_modified_since
functionsize
argument was used to add a length
parameter to the HTTP header.StreamField
s must explicitly set use_json_field
argument to True
/False
StreamField
now requires a use_json_field
keyword argument that can be set to True
/False
. If set to True
, the field will use JSONField
as its internal type instead of TextField
, which will change the data type used on the database and allow you to use JSONField
lookups and transforms on the StreamField
. If set to False
, the field will keep its previous behaviour and no database changes will be made. If set to None
(the default), the field will keep its previous behaviour and a warning (RemovedInWagtail50Warning
) will appear.
After setting the keyword argument, make sure to generate and run the migrations for the models.
clean_name
on AbstractFormField
clean_name
field was added to form field models that extend AbstractFormField
and this initially supported legacy migration of the Unidecode label conversion.