'Add a custom link/model to wagtail's admin sub-menu

Wagtail documentation explains how to:

Let our model be CustomManager and its admin url be /admin/custom_manager/.

Using a hook, we can add a link to our page on to the first level of the admin menu:

@hooks.register('register_admin_menu_item')
def register_edit_menu_item():
  return MenuItem( 'Custom Manager', '/admin/custom_manager/', classnames='icon icon-folder-inverse', order=1000)

But how can we add this link to a sub-menu/group, when our model is not a wagtail model?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source