Hatim
Hatim

Reputation: 1522

How to reorder Wagtail admin menu items

There are some custom menu items in the admin's menu, it is easy to order them (the items marked in red below). Just set menu_order of the custom ModelAdmin object.

The question is how to reorder the built-in menu items, such as Pages, Images, Media, and Settings.

enter image description here

Upvotes: 3

Views: 768

Answers (1)

gasman
gasman

Reputation: 25227

You can use the construct_main_menu hook to modify existing menu items.

For example, to move the Pages item to the bottom, place this code in a wagtail_hooks.py file within one of your apps:

from wagtail import hooks

@hooks.register('construct_main_menu')
def reorder_menu_items(request, menu_items):
    for item in menu_items:
        if item.name == 'explorer':  # internal name for the Pages menu item
            item.order = 100000
            break

Upvotes: 3

Related Questions