Skip to content

Paginate with offset #99

@missmatsuko

Description

@missmatsuko

Is it possible to paginate a query with offset?
https://craftcms.stackexchange.com/questions/19924/how-to-skip-the-first-x-entries-using-elementapi

My use case is that I'm adding items to a page. The page loads with 4 items (1 row of 1, 1 row of 3) then paginates with 6 items (2 rows of 3) so I can't just paginate and start from the second page.

I found that offset works if paginate is set to false, but then it's trickier to figure out if I've reached the end of results.

I have figured out that I can still use pagination if I exclude IDs in criteria, so currently I'm thinking to pass the IDs of the first 4 items into my endpoint and exclude those.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions