get_prev/next_sibling docs.

This commit is contained in:
A. Jesse Jiryu Davis 2016-01-06 16:51:39 -05:00
parent 50164c18dd
commit 20a79ce1f1
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,24 @@
title: get_next_sibling
---
summary: Returns the next record.
---
type: method
---
body:
Get the next record in this record's parent's list of children.
If the parent record has pagination enabled, then `get_prev_sibling` and
`get_next_sibling` use the pagination query to filter and order the children.
Otherwise, the parent's standard configuration for children is used.
See [the pagination guide :ref](../../../../guides/pagination/) and the
[page order guide :ref](../../../../guides/page-order/).
## Example
```html+jinja
{% set newer = this.get_next_sibling() %}
{% if newer %}
<a href="{{ newer|url }}">Next article: {{ newer.title }}</a>
{% endif %}
```

View File

@ -0,0 +1,24 @@
title: get_prev_sibling
---
summary: Returns the previous record.
---
type: method
---
body:
Get the previous record in this record's parent's list of children.
If the parent record has pagination enabled, then `get_prev_sibling` and
`get_next_sibling` use the pagination query to filter and order the children.
Otherwise, the parent's standard configuration for children is used.
See [the pagination guide :ref](../../../../guides/pagination/) and the
[page order guide :ref](../../../../guides/page-order/).
## Example
```html+jinja
{% set older = this.get_prev_sibling() %}
{% if older %}
<a href="{{ older|url }}">Previous article: {{ older.title }}</a>
{% endif %}
```