I have updated the guestbook plugin to a recent plugin skeleton using flex-objects, see https://github.com/pikim/grav-plugin-guestbook. Now I'd like to be able to paginate the stored messages in twig using the standard pagination plugin. Is this possible?
If I do
{% set collection = grav.get('flex').collection('guestbook') %}
{% do paginate(collection, 3) %}
I get the error that the types of argument 1 don't match:
Argument 1 passed to Grav\Plugin\Pagination\PaginationHelper::__construct() must be an instance of Grav\Common\Page\Collection, instance of Grav\Common\Flex\Types\Generic\GenericIndex given
The manual says that flex collections can be paginated with the slice filter. But this way I would have to write all the business logic behind that, wouldn't I?