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;
|
2016-04-16 22:23:20 +00:00
|
|
|
if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blog' ) {
|
2016-04-04 11:17:05 +00:00
|
|
|
$subnav = true;
|
|
|
|
}
|
|
|
|
}else if ($page->depth() == 2) {
|
|
|
|
$baseSec = $page->parent();
|
2016-04-16 22:23:20 +00:00
|
|
|
if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blogarticle' ) {
|
2016-04-04 11:17:05 +00:00
|
|
|
$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">
|
2016-05-20 22:26:34 +00:00
|
|
|
<nav>
|
|
|
|
<ul class="nav mobileNav">
|
|
|
|
<li><a href="<?php echo $site->url()?>">Home</a></li>
|
|
|
|
<?php foreach ($site->children()->visible() as $p) : ?>
|
|
|
|
<li><a href="<?php echo $p->url()?>" <?php echo ($page == $p)?'class="active"':'' ?>><?php echo $p->title() ?></a></li>
|
|
|
|
<?php if ($p->hasVisibleChildren() && $p->template() != 'blog') : ?>
|
|
|
|
<ul class="">
|
|
|
|
<?php foreach ($p->children()->visible() as $c) : ?>
|
|
|
|
<li><a href="<?php echo $c->url()?>" <?php echo ($page == $c)?'class="active"':'' ?>><?php echo $c->title() ?></a></li>
|
2016-04-04 11:17:05 +00:00
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
2016-05-20 22:26:34 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2016-04-04 11:17:05 +00:00
|
|
|
</div>
|
|
|
|
|
2016-04-02 22:24:34 +00:00
|
|
|
<header class="section">
|
2016-03-31 08:37:32 +00:00
|
|
|
<div class="container">
|
2016-04-07 20:06:04 +00:00
|
|
|
<?php if ($img = $site->images()->find($site->title_image())) : ?>
|
2016-03-31 08:37:32 +00:00
|
|
|
<a class="logo" href="<?php echo url() ?>">
|
2016-04-27 20:44:51 +00:00
|
|
|
<img src="<?php echo $site->url().'/content/'.$site->title_image()->html() ?>" alt="Logo">
|
2016-03-31 08:37:32 +00:00
|
|
|
</a>
|
2016-04-07 20:06:04 +00:00
|
|
|
<?php endif; ?>
|
2016-04-04 11:17:05 +00:00
|
|
|
|
2016-04-16 22:23:20 +00:00
|
|
|
<nav aria-hidden="true">
|
2016-07-09 17:17:08 +00:00
|
|
|
<button class="btn btn-lg btn-secondary navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar">
|
2016-04-24 21:02:37 +00:00
|
|
|
Menü
|
2016-04-04 11:17:05 +00:00
|
|
|
</button>
|
|
|
|
|
2016-05-20 22:26:34 +00:00
|
|
|
<ul class="nav hidden-xs-down">
|
|
|
|
<?php if(!$subnav) : ?>
|
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; ?>
|
2016-05-20 22:26:34 +00:00
|
|
|
<?php else : ?>
|
|
|
|
<a href="<?php echo $baseSec->url()?>" class="section <?php echo ($page == $baseSec)?'active':'' ?>"><li><?php echo $baseSec->title() ?>:</li></a>
|
2016-04-04 11:17:05 +00:00
|
|
|
<?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; ?>
|
2016-04-04 11:17:05 +00:00
|
|
|
<?php endif; ?>
|
2016-05-20 22:26:34 +00:00
|
|
|
</ul>
|
2016-04-02 22:24:34 +00:00
|
|
|
</nav>
|
2016-03-31 08:37:32 +00:00
|
|
|
</div>
|
|
|
|
</header>
|