contentful_middleman
contentful_middleman copied to clipboard
How to set the pagination?
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?
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