In Craft 3 how do I find the title of the previous and next entry when looping through a channel? {# Set parameters for prev/next elements list #}
{% set params = craft.entries.section('nieuws').all() %}

{# Get the prev/next elements #}
{% set nextEntry = entry.getNext(params) %}


This used to work in Craft 2 in v3 I get an unknown property error. I can retrieve the prev and next links via the paginate tag but how do I retrieve the titles of the prev and next entry??
This did the trick - I'm assuming a news channel here with datestamped entries.

{% set query = craft.entries
    .section('nieuws')
    .id('not ' ~ entry.id)
    .limit(1) %}

{% set prevEntry = clone(query)
    .postDate('&lt;= ' ~ entry.postDate.timestamp)
    .order('postDate desc')
    .one() %}

{% set nextEntry = clone(query)
    .postDate('&gt;= ' ~ entry.postDate.timestamp)
    .order('postDate asc')
    .one() %}

{% if prevEntry %}
  &lt;p&gt;&lt;a href="{{ prevEntry.url }}"&gt;&lt; {{ prevEntry.title }}&lt;/a&gt;&lt;/p&gt;
{% endif %}

{% if nextEntry %}
  &lt;p&gt;&lt;a href="{{ nextEntry.url }}"&gt;{{ nextEntry.title }} &gt;&lt;/a&gt;&lt;/p&gt;
{% endif %}


Hat tip to How to get the previous or next two entries