Dominyka Posted May 7, 2019 Share 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. Link to comment Share on other sites More sharing options...
opentype Posted May 7, 2019 Share Posted May 7, 2019 Needs a manual database query. You can’t get it as easily as next unread. Link to comment Share on other sites More sharing options...
Meddysong Posted May 7, 2019 Share Posted May 7, 2019 Adriano seemed to find a solution once but it's too technical for me to be able to do: Link to comment Share on other sites More sharing options...
Martin A. Posted May 7, 2019 Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.