plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
448 stars 610 forks source link

Pagination in folder views #2925

Open mcasagrande18 opened 2 years ago

mcasagrande18 commented 2 years ago

Insert pagination in SummaryView, TabularView, AlbumView and ListingView like in Plone Classic Theme, otherwise I can see only first 25 items in a folder.

mcasagrande18 commented 2 years ago

Has this functionality been taken into consideration?

teekuningas commented 1 year ago

This is a problem for us too. One cannot even increase the size of batches, as defaultPageSize has no effect on folders.

davisagli commented 1 year ago

I think this would make sense to add; I'm not sure about the complexity. But note that these days Volto comes with the Folder type disabled, and it's possible to use a page with the listing block, which already includes pagination.

tiberiuichim commented 1 year ago

@davisagli Using a Page instead of a Folder wouldn't fix the problem.

The idea is that the listing block behaves in two modes:

By default, when you add the listing block and don't make any changes to the Query, it acts as folder listing. Honestly, there's a lot of problems with this behavior and makes things more complicated then they should be. For example, the shape of items and querystring serialized brains is different, so if you use a Listing template that demands something beyond basic info, you can't use it as "folder contents"

davisagli commented 1 year ago

@tiberiuichim Thanks for the clarification. I didn't realize that items does not use the summary serialization. I wonder if there's some way we could make it so the template can declare whether it expects the full object serialization or not.

wesleybl commented 1 year ago

By default, when you add the listing block and don't make any changes to the Query, it acts as folder listing. Honestly, there's a lot of problems with this behavior and makes things more complicated then they should be. For example, the shape of items and querystring serialized brains is different, so if you use a Listing template that demands something beyond basic info, you can't use it as "folder contents"

Wouldn't it be better to use querystring, even when we don't select any criteria? See:

https://github.com/plone/volto/issues/3839#issuecomment-1305766462

That would make things more standardized as well.

But the pagination is working in the listing block.

wesleybl commented 1 year ago

But the pagination is working in the listing block.

Well it works if you select some criteria. Otherwise, it doesn't really work.

wesleybl commented 1 year ago

I wonder if there's some way we could make it so the template can declare whether it expects the full object serialization or not.

@davisagli If it's for performance reasons, the variation could indicate that. See:

https://github.com/plone/volto/blob/20840fdc5fc5a80e77e53ac04a028b613d444eaf/src/components/manage/Blocks/Listing/withQuerystringResults.jsx#L30

But the issue is in the views and not in the blocks. Then we may be talking in the wrong place :smile: