Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom columns / filters on main page explorer #11931

Open
krzysztofjeziorny opened this issue May 7, 2024 · 1 comment
Open

Support custom columns / filters on main page explorer #11931

krzysztofjeziorny opened this issue May 7, 2024 · 1 comment

Comments

@krzysztofjeziorny
Copy link
Contributor

krzysztofjeziorny commented May 7, 2024

The PageListingViewSet documentation on Custom page listings in Wagtail 6.1 is very nice, that allows nice listings of specific model pages.

However, it is not clear to me if it's possible to use the method to customize the standard lists of content accessed from the page tree? And if so, how to do that?

In my case I'd like to add a column and a filter to all pages, just as in a custom listing.

Many thanks!

@gasman gasman changed the title [request] Documentation on PageListingViewSet Support custom columns / filters on main page explorer May 7, 2024
@gasman
Copy link
Collaborator

gasman commented May 7, 2024

Thanks for the suggestion @krzysztofjeziorny! Customising the main explorer view through PageListingViewSet isn't currently supported, so this isn't just a documentation issue - have updated the issue title accordingly.

A large part of the difficulty here is that the listing is always generated by querying the base Page model (since we don't know in advance which page types will exist in the currently viewed section - even if a subpage_types rule is in place, there might be other pages still remaining from before that rule was added), and so we can't filter on fields defined on more specific page types.

I think we could handle that by associating PageListingViewSet subclasses with particular parent page models - so, for example, you could define an EventPageListingViewSet based on an EventPage model that adds a column / filter on the event's date field, and configure that to be used whenever you're viewing children of an EventIndexPage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants