2016-03-31 08:37:32 +00:00
|
|
|
<?php
|
|
|
|
// -------------------------------------------
|
|
|
|
// kirby snippet FOR jannikbeyerstedt.de
|
|
|
|
|
|
|
|
// copyright: Jannik Beyerstedt | https://jannikbeyerstedt.de
|
|
|
|
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
|
|
|
|
// -------------------------------------------
|
2016-04-04 11:17:05 +00:00
|
|
|
|
|
|
|
$subnav = false;
|
|
|
|
if ($page->depth() == 1) {
|
|
|
|
$baseSec = $page;
|
|
|
|
if ( $page->isVisible() && $baseSec->hasVisibleChildren() ) {
|
|
|
|
$subnav = true;
|
|
|
|
}
|
|
|
|
}else if ($page->depth() == 2) {
|
|
|
|
$baseSec = $page->parent();
|
|
|
|
if ( $page->isVisible() && $baseSec->hasVisibleChildren() ) {
|
|
|
|
$subnav = true;
|
|
|
|
}
|
|
|
|
}
|
2016-03-31 08:37:32 +00:00
|
|
|
?>
|
2016-04-04 11:17:05 +00:00
|
|
|
|
|
|
|
<div class="collapse hidden-sm-up" id="exCollapsingNavbar">
|
|
|
|
<div class="bg-inverse p-a-1">
|
|
|
|
<nav>
|
|
|
|
<ul class="nav mobileNav">
|
|
|
|
<?php foreach ($site->children()->visible() as $p) : ?>
|
|
|
|
<a href="<?php echo $p->url()?>" <?php echo ($page == $p)?'class="active"':'' ?>><li><?php echo $p->title() ?></li></a>
|
|
|
|
<?php if ($p->hasVisibleChildren()) : ?>
|
|
|
|
<ul class="">
|
|
|
|
<?php foreach ($p->children()->visible() as $c) : ?>
|
|
|
|
<a href="<?php echo $c->url()?>" <?php echo ($page == $c)?'class="active"':'' ?>><li><?php echo $c->title() ?></li></a>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-04-02 22:24:34 +00:00
|
|
|
<header class="section">
|
2016-03-31 08:37:32 +00:00
|
|
|
<div class="container">
|
|
|
|
<a class="logo" href="<?php echo url() ?>">
|
2016-04-02 22:24:34 +00:00
|
|
|
<img src="" alt="Logo">
|
2016-03-31 08:37:32 +00:00
|
|
|
</a>
|
2016-04-04 11:17:05 +00:00
|
|
|
|
2016-04-02 22:24:34 +00:00
|
|
|
<nav>
|
2016-04-04 11:17:05 +00:00
|
|
|
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar">
|
|
|
|
Menü <i class="fa fa-bars"></i>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<ul class="nav hidden-xs-down <?php echo ($subnav)?'main':'home' ?>">
|
2016-04-02 22:24:34 +00:00
|
|
|
<?php foreach ($site->children()->visible() as $p) : ?>
|
2016-04-04 11:17:05 +00:00
|
|
|
<a href="<?php echo $p->url()?>" <?php echo ($page == $p || $page->parent() == $p)?'class="active"':'' ?>><li><?php echo $p->title() ?></li></a>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<?php if($subnav) : ?>
|
|
|
|
<ul class="nav hidden-xs-down second">
|
|
|
|
<?php foreach ($baseSec->children()->visible() as $p) : ?>
|
|
|
|
<a href="<?php echo $p->url()?>" <?php echo ($page == $p)?'class="active"':'' ?>><li><?php echo $p->title() ?></li></a>
|
2016-04-02 22:24:34 +00:00
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
2016-04-04 11:17:05 +00:00
|
|
|
<?php endif; ?>
|
2016-04-02 22:24:34 +00:00
|
|
|
</nav>
|
2016-03-31 08:37:32 +00:00
|
|
|
</div>
|
|
|
|
</header>
|