2
votes

I've been using wagtail-modeladmin to create custom lists of certain page types. That gives me the ability to edit those pages. But I'd also like to be able to click through somehow to the "normal" admin explorer version of those pages, and be able to view/add child pages to them.

essentially giving myself a column with the little arrows in on the right, just like in the normal wagtail admin page explorer...

1

1 Answers

3
votes

OK I know it's bad form to answer your own question, but I've got this working by using a custom method on the model admin object that reverse wagtails admin urls:

class MySpecialPageModelAdmin(ModelAdmin):
    def view_children(self, obj):
        url = reverse('wagtailadmin_explore', args=[obj.id])
        return format_html(f'<a href="{url}">View Children</a>')

    list_display = ('title', 'live', 'view_children')

but actually, I think I'm not going to end up using this, just replacing this particular modeladmin with a direct link to the right place in the explorer.