Batch sizes in views

If one wants to change ALL places batch it 20 to 40-50 (folder listing, summary view, table listing etc, search results etc.): Is this scattered 'all around' or just a few places … plone.app.contentlisting maybe ?

I don't know the answer but its something I've wondered myself. Its one of those things that should be a control panel setting.

Each time you create a batch in python code you need to set the size of that batch:

So you need to change all around.

When using Collections, you can set the batch size directly in the collection options, so I guess you can patch it to provide a different default value for the batch size. But this would work only for collections.

Looks like 'quite a lot' is defined in plone.app.contenttypes

I made this if it should be of any interest: https://github.com/espenmn/medialog.batchsize

It adds a control panel where you can set batch size for some common views and also an option to hide items that are marked 'exclude_from_nav'.

Unfortunately, I found no way to avoid duplicating the templates ( is it possible to link to templates from another add-on ?)

In ZCML you can do:

<configure ....>
     <configure package="plone.app.contenttype.browser">
                <browser:page
                          for="Products.CMFPlone.interfaces.IPloneSiteRoot"
                          class=".folder.FolderView"
                          layer="medialog.batchsize.interfaces.IMedialogBatchsizeLayer"
                          permission="zope2.View"
                          template="templates/listing.pt"
                />
     </configure>
</configure>

And the relative things (either class or template) are taken from the package stated in the configure tag, so I guess you can use something like that but pointing to your class (with the full dotted name).

please please just put it in a PR for base plone. save everyone the pain of dealing with later.

I took a look in /portal_view/customization, and there are LOADS of duplicate view(names )s, so I am not sure how smart it is to add this without a proper plan (suddenly there is one view that uses default 20 anyway).

PS: I can add a PR, but what about adding it for just plone.app.contentypes ?