Jahan
Jahan

Reputation: 392

How to add a custom action button to the wagtail admin changelist pages?

I want to achieve this feature for models that registered via modeladmin module.

Upvotes: 0

Views: 3157

Answers (1)

Loïc Teixeira
Loïc Teixeira

Reputation: 1434

You should be able to use the register_page_listing_buttons or register_page_listing_more_buttons hooks.

Example from the documentation:

from wagtail.admin import widgets as wagtailadmin_widgets

@hooks.register('register_page_listing_buttons')
def page_listing_buttons(page, page_perms, is_parent=False):
    yield wagtailadmin_widgets.PageListingButton(
        'A page listing button',
        '/goes/to/a/url/',
        priority=10
    )

Upvotes: 3

Related Questions