Search code examples
pythondjangocontent-management-systemadminwagtail

Is there a way to order Wagtail Blocks in the Admin Panel


Currently I have all blocks split out into different groups for the page editors to easily navigate through the different block options. However, from reading the documentation I cannot see any way to specifically order the groups.

enter image description here

It would be great to be able to customise this so that I could have the text editor group at the top, the image group/carousel block next to each other etc.


Solution

  • This isn't currently supported - as of Wagtail 4.1, groups of blocks are always listed alphabetically by group name. Here's where this is implemented.

    You could probably override this behaviour by subclassing StreamField and defining your own grouped_child_blocks method, but be aware that this isn't an officially documented method and could potentially be changed or dropped without warning in a future Wagtail release.