@audibleid.
About prev() and next(), I must say it is more complex.
For sure, both functions does the same in opposite directions, but it is not the incrementation of the id.
Your Next element can have an inferior id. It depends how it has been ordered, filterred, published, accessless, etc...
So this is why you must use the collection model, in order to implement all these filters and wizards.
The only thing to do is to create a custom sql profile, which will apply all the where and joins normally (list), but wich will return only ONE item : the NEXT or PREV.
So. Ready for it ?
When it is done, thanks to share
Just some clue :
For retreiving a neibourg element, you must base on :
- Ordering (if exists)
- Column current sorting (or search result sorting). This is when the user click to sort a column.
- The ordering, or sorting direction (ASC / DESC)
- Ordering default field (example : title)
- Id value (of course by default fallback)
Good program, and good sunday ...