diff --git a/content/docs/api/db/record/get_next_sibling/contents.lr b/content/docs/api/db/record/get_next_sibling/contents.lr new file mode 100644 index 00000000..e00c80cd --- /dev/null +++ b/content/docs/api/db/record/get_next_sibling/contents.lr @@ -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 %} +Next article: {{ newer.title }} +{% endif %} +``` diff --git a/content/docs/api/db/record/get_previous_sibling/contents.lr b/content/docs/api/db/record/get_previous_sibling/contents.lr new file mode 100644 index 00000000..813a86b8 --- /dev/null +++ b/content/docs/api/db/record/get_previous_sibling/contents.lr @@ -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 %} +Previous article: {{ older.title }} +{% endif %} +```