From 20a79ce1f10d86328522563f7b543d106f80b112 Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Wed, 6 Jan 2016 16:51:39 -0500 Subject: [PATCH] get_prev/next_sibling docs. --- .../db/record/get_next_sibling/contents.lr | 24 +++++++++++++++++++ .../record/get_previous_sibling/contents.lr | 24 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 content/docs/api/db/record/get_next_sibling/contents.lr create mode 100644 content/docs/api/db/record/get_previous_sibling/contents.lr 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 %} +```