Skip to content
Snippets Groups Projects
Unverified Commit 138a88e0 authored by Daniel Rudolf's avatar Daniel Rudolf
Browse files

Use Twig pages function for navigation

parent 470a7340
Branches
No related tags found
No related merge requests found
......@@ -32,13 +32,10 @@
</h1>
<div id="nav" role="region" tabindex="-1">
<ul>
{% for page in pages if page.title and not page.hidden %}
{% set pageDepth = page.id|split('/')|length %}
{% if (pageDepth == 2) and (page.id ends with "/index") or (pageDepth == 1) %}
{% for page in pages(depthOffset=-1) if page.title and not page.hidden %}
<li{% if page.id == current_page.id %} class="active"{% endif %}>
<a href="{{ page.url }}">{{ page.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment