Edit on GitHub
Jump to docs navigation

Twig Components / Methods / next

next(byColumn = "id", sameContentType = true) is a Twig filter to return the next record from the database. By default, |next finds the right adjacent element for the same contenttype using the record's database id.

{% set record_after = record|next %} 
Parameter Description
byColumn Sort records based on the passed column's value. Default is id
sameContentType If set to true, it only sorts records of the same contenttype. Default is true


Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.