Page Navigation

Provides access to general information regarding navigation around a page including parent pages, children, breadcrumbs, level, etc.

Returns the children of the page as a hash.

Usage

{{ page.children }}

Example

{% if page.has_children? %}
  This page has {{ page.children.length }} sub-pages.
{% endif %}

Returns true if the page has any sub-pages (whether or they be hidden).

Usage

{% if page.has_children? %}
  This page has sub-pages.
{% endif %}

Returns true if the page has any hidden sub-pages.

Usage

{% if page.has_hidden_children? %}
  This page has hidden sub-pages.
{% endif %}

Returns true if the page has a parent page.

Usage

{% if page.has_parent? %}
  This page has a parent-page.
{% endif %}

Returns true if the page has any visible sub-pages.

Usage

{% if page.has_visible_children? %}
  This page has visible sub-pages.
{% endif %}

Returns the sub-pages of the page which are hidden as a hash.

Usage

{{ page.hidden_children }}

Example

{% if page.has_hidden_children? %}
  This page has {{ page.hidden_children.length }} subpages.
{% endif %}

Returns true if the page is a root page.

Usage

{% if page.root? %}
  This is the root page.
{% endif %}

Returns the depth of the page in the navigation.

Usage

{{ page.level }}

Returns the next page. The last page returns itself.

Usage

{{ page.next_page }}

Example

<a href="{{page.next_page}}">Go to next page</a>

Returns the parent-page.

Usage

{{ page.parent }}

Example

<a href="{{ page.parent.url }}">Parent</a>

Returns the previous page. The first page returns itself.

Usage

{{ page.previous_page }}

Example

<a href="{{ page.previous_page }}">Go to previous page</a>

Returns the sub-pages of the page which are visible as a hash.

Usage

{{ page.visible_children }}

Example

{% if page.has_visible_children? %}
  This page has {{ page.visible_children.length }} subpages.
{% endif %}

Returns the root ancestor of the page.

Usage

{{ page.root }}

Example

<a href="{{ page.root.url }}">
  Go back to {{ page.root.name }}
</a>