Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

How to set the pagination? #160

Open
t1gerk1ngd0m opened this issue Jul 27, 2020 · 1 comment
Open

How to set the pagination? #160

t1gerk1ngd0m opened this issue Jul 27, 2020 · 1 comment

Comments

@t1gerk1ngd0m
Copy link

Hello, I use this gem on our corporate blog site. It's easy to access to the Contentful.

But I'm in trouble because I cannot set the pagination. Are there any good way to set the pagination?

@dlitvakb
Copy link
Contributor

dlitvakb commented Jul 27, 2020

If you're fetching the content using all_entries: true, then it's a matter of defining either in the proxy section of your config the pages, by calculating the amount of entries you have vs how many you want per page, then passing those numbers (current page/page size) through locals where you can use them to iterate over your collection and skipping/collecting the right amount of entries. Or having all of them directly in a single page and having your pagination done using some frontend framework (the data always being there, just hidden to the user until they scroll to the appropriate page).

Hope this helps

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

No branches or pull requests

2 participants