---
layout: base
---
{% if page.sub-nav-group and page.sub-nav-parent != "_root_" %}
{% comment %}
The plain layout with a sub navigation.
- This is activated via the 'sub-nav-group' field in the preemble.
- All pages of this sub nav group will be displayed in the sub navigation:
* Each element without a 'sub-nav-parent' field will be displayed on the 1st level, where the position is defined via 'sub-nav-pos'.
* If the page should be displayed as a child element, it needs to specify a 'sub-nav-parent' field, which matches the 'sub-nav-id' of its parent. The parent only needs to specify this if it expects child nodes.
{% endcomment %}
{% comment %} Get all pages belonging to this group sorted by their position {% endcomment %}
{% assign group = (site.pages | where: "sub-nav-group" , page.sub-nav-group | where: "sub-nav-parent", "_root_" | sort:"sub-nav-pos") %}
{% for group_page in group %}
{% if group_page.sub-nav-id %}
{% assign sub_group = (site.pages | where: "sub-nav-group" , page.sub-nav-group | where: "sub-nav-parent" , group_page.sub-nav-id | sort: "sub-nav-pos") %}
{% else %}
{% assign sub_group = nil %}
{% endif %}
- {% if group_page.sub-nav-title %}{{ group_page.sub-nav-title }}{% else %}{{ group_page.title }}{% endif %}
{% if sub_group %}
{% endif %}
{% endfor %}
{% else %}
{{ content }}
{% endif %}