Next
Grab the next Pages relative to your current Page.
Example
This will show the next 2 pages sibling pages. It’ll scope the loop into the stories
tag pair. If there are no more pages, the no results text will be shown.
{{ pages:next as="stories" limit="2" }}
{{ if no_results }}
No more stories to read!
{{ /if }}
{{ stories }}
<div class="story">
<a href="{{ url }}">{{ title }}</a>
</div>
{{ /stories }}
{{ /pages:next }}
Note: When using as
, don’t use as="pages"
since it will assume you are trying to use the Pages Tag.
Parameters
from|folder|url
string |
The name of the page to search within. When left blank, the current URL's parent will be used. In most cases, it makes sense to leave this blank. |
---|---|
wrap
boolean false |
When set to |
current
string current url |
The URL for the piece of content that is considered to be “current.” (This tag will display the next pages in the list 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 |
---|