Next

Grab the next entries relative to current entry in a Collection.


Example

This will show the next 2 posts in the blog collection. It’ll scope the entries loop into the posts tag pair. If there are no more entries, the no results text will be shown.

{{ collection:next in="blog" as="posts" limit="2" sort="date:asc" }}

  {{ if no_results }}
    No more posts to read!
  {{ /if }}

  {{ posts }}
    <div class="post">
      <a href="{{ url }}">{{ title }}</a>
    </div>
  {{ /posts }}

{{ /collection:next }}

Parameters

in|collection

string

The name of the collection to search within.

wrap

boolean false

When set to true, this tag will wrap around to the other end of the list. In scenarios where there wouldn’t be a next entry, the first entry will be returned.

current

string current url

The URL for the piece of content that is considered to be “current.” (This tag will display the next entries in the listing after the current one, if one exists.)

collection params

inheritance

All parameters available on the collection tag are also available here.


Variables

no_results

boolean

This will be true if there are no results.

Last modified on September 11, 2016