2018-02-17 11:32:05 +01:00
|
|
|
<nav class="sidebar">
|
|
|
|
<?php
|
|
|
|
// Get all parent pages
|
|
|
|
$parents = buildParentPages();
|
|
|
|
foreach ($parents as $parent) {
|
|
|
|
// Print the parent page title
|
|
|
|
echo '<h6 class="text-uppercase">'.$parent->title().'</h6>';
|
2018-02-06 23:11:50 +01:00
|
|
|
|
2018-02-17 11:32:05 +01:00
|
|
|
// Check if the parent page has children
|
|
|
|
if ($parent->hasChildren()) {
|
|
|
|
// Get the list of children
|
|
|
|
$children = $parent->children();
|
2018-02-09 00:46:12 +01:00
|
|
|
|
2018-02-17 11:32:05 +01:00
|
|
|
echo '<ul class="nav flex-column">';
|
|
|
|
foreach ($children as $child) {
|
|
|
|
if ($child->key()==$url->slug()) {
|
|
|
|
echo '<li class="nav-item-active">';
|
|
|
|
} else {
|
2018-02-09 00:46:12 +01:00
|
|
|
echo '<li class="nav-item">';
|
2018-02-08 00:20:00 +01:00
|
|
|
}
|
2018-02-17 11:32:05 +01:00
|
|
|
echo '<a class="nav-link" href="'.$child->permalink().'">'.$child->title().'</a>';
|
|
|
|
echo '</li>';
|
2018-02-08 00:20:00 +01:00
|
|
|
}
|
2018-02-17 11:32:05 +01:00
|
|
|
echo '</ul>';
|
2018-02-08 00:20:00 +01:00
|
|
|
}
|
2018-02-17 11:32:05 +01:00
|
|
|
}
|
|
|
|
?>
|
2018-02-06 23:11:50 +01:00
|
|
|
</nav>
|