craftcms / element-api

Create a JSON API/Feed for your elements in Craft.
MIT License
498 stars 57 forks source link

Added offset to criteria config #3

Closed oncode closed 7 years ago

oncode commented 8 years ago

Instead of just overwriting the offset criteria from the config with the current page offset, the config offset should be added to the page offset and also change the total results number (for correct pagination).

I needed this for a infinite scroll to load entries via ajax (because X entries were already preloaded in the twig template). It could come in handy for some folks and should work with existing implementations. ;)