Dominyka Posted May 7, 2019 Posted May 7, 2019 I know there is a way to get the next Unread Database record $record->url()->setQueryString( array( 'do' => 'nextUnread' ) ) $record->url()->setQueryString( array( 'do' => 'nextUnread' ) ) But can I get the next record regardless of whether it has been read or not? 'do' => 'next' doesn't work.
opentype Posted May 7, 2019 Posted May 7, 2019 Needs a manual database query. You can’t get it as easily as next unread.
Meddysong Posted May 7, 2019 Posted May 7, 2019 Adriano seemed to find a solution once but it's too technical for me to be able to do:
Martin A. Posted May 7, 2019 Posted May 7, 2019 {{$nextItem = $record->nextItem();}} {{if $nextItem !== NULL}} <a href="{$nextItem->url()}">{$nextItem->_title}</a> {{endif}} But yes, it adds one database query. And I do not know if this has performance issues on larger installations. It is also possible to add a "?do=next" as a plugin, where you won't have that extra query unless you click the link. EDIT: Was not aware of the issues expressed in the topic @Meddysong linked to. It's not as straight forward as I thought.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.