kirby3-commentions
kirby3-commentions copied to clipboard
Pagination in commentions blueprint section?
Is it possible to display the "to be approved" or "all" comments in the commentions section with a pagination? I had a brief look at the components/Section.vue
and sections/commentions.php
but it seems as if all data is loaded and displayed at once, is it?
Here’s my use case: I want to display all comments. Because this list could get very long, I’m afraid that at some point (1000s) of items, the panel load and display performance may suffer.
Just want to know if I’m missing something. Otherwise I can try to contribute some pagination code :)
Your observation is correct: pagination is something we may have talked about, but probably considered a "we'll deal with it when it becomes an issue" feature. Maybe that time has come :)
Since the listing component was originally developed from Kirby's native section components, adding the Pagination could be rather straightforward by reusing e.g. https://github.com/getkirby/kirby/blob/master/panel/src/components/Navigation/Pagination.vue -- the PHP code would of course need to be extended to return paginated comments (rather than the whole thing, as is the case currently).
Collaboration is always welcome; we can discuss the approach in this thread. Pinging @fabianmichael (who authored a lot of Commentions' panel magic) as well ...please don't feel obliged, but in case you have any insight or thoughts on this.
@sebastiangreger I’ll have a look at it, but that’ll probably take a few days.
Commentions 2.0, just out in its first beta, now has pagination in the commentions panel. Default is 20 (as with other sections), but you can change that yourself in the blueprint: https://github.com/sebastiangreger/kirby3-commentions/tree/develop#commentions-1
This is fantastic! Can’t wait to try this out on my next project! Thank you!