Upgrade to Kirby 3
This commit is contained in:
parent
80004a968c
commit
03ab30b8c1
64 changed files with 524 additions and 683 deletions
|
@ -9,12 +9,12 @@
|
|||
$subnav = false;
|
||||
if ($page->depth() == 1) {
|
||||
$baseSec = $page;
|
||||
if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blog' ) {
|
||||
if ( $page->isListed() && $baseSec->hasListedChildren() && $page->template() != 'blog' ) {
|
||||
$subnav = true;
|
||||
}
|
||||
}else if ($page->depth() == 2) {
|
||||
$baseSec = $page->parent();
|
||||
if ( $page->isVisible() && $baseSec->hasVisibleChildren() && $page->template() != 'blogarticle' ) {
|
||||
if ( $page->isListed() && $baseSec->hasListedChildren() && $page->template() != 'blogarticle' ) {
|
||||
$subnav = true;
|
||||
}
|
||||
}
|
||||
|
@ -26,11 +26,11 @@ if ($page->depth() == 1) {
|
|||
<nav class="mobile">
|
||||
<ul class="nav mobileNav">
|
||||
<li><a href="<?php echo $site->url()?>">Home</a></li>
|
||||
<?php foreach ($site->children()->visible() as $p) : ?>
|
||||
<?php foreach ($site->children()->listed() 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') : ?>
|
||||
<?php if ($p->hasListedChildren() && $p->template() != 'blog') : ?>
|
||||
<ul class="">
|
||||
<?php foreach ($p->children()->visible() as $c) : ?>
|
||||
<?php foreach ($p->children()->listed() as $c) : ?>
|
||||
<li><a href="<?php echo $c->url()?>" <?php echo ($page == $c)?'class="active"':'' ?>><?php echo $c->title() ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
@ -52,12 +52,12 @@ if ($page->depth() == 1) {
|
|||
<nav aria-hidden="true">
|
||||
<ul class="nav d-none d-sm-block">
|
||||
<?php if(!$subnav) : ?>
|
||||
<?php foreach ($site->children()->visible() as $p) : ?>
|
||||
<?php foreach ($site->children()->listed() as $p) : ?>
|
||||
<a href="<?php echo $p->url()?>" <?php echo ($page == $p || $page->parent() == $p)?'class="active"':'' ?>><li><?php echo $p->title() ?></li></a>
|
||||
<?php endforeach; ?>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo $baseSec->url()?>" class="section <?php echo ($page == $baseSec)?'active':'' ?>"><li><?php echo $baseSec->title() ?>:</li></a>
|
||||
<?php foreach ($baseSec->children()->visible() as $p) : ?>
|
||||
<?php foreach ($baseSec->children()->listed() as $p) : ?>
|
||||
<a href="<?php echo $p->url()?>" <?php echo ($page == $p)?'class="active"':'' ?>><li><?php echo $p->title() ?></li></a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -64,8 +64,5 @@ echo js('assets/vendors/bootstrap/js/dist/carousel.js');
|
|||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php echo piwik(); ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -16,7 +16,7 @@ $a = $article;
|
|||
<a class="more" href="<?php echo $a->url()?>">»</a>
|
||||
</p>
|
||||
<div class="meta">
|
||||
<time datetime="<?php echo $a->date('Y-m-d') ?>"><?php echo $a->date('d. M. Y') ?></time>
|
||||
<time datetime="<?php echo $a->date()->toDate('Y-m-d') ?>"><?php echo $a->date()->toDate('d. M. Y') ?></time>
|
||||
<?php echo tags($base_url, $a); ?>
|
||||
</div>
|
||||
</article>
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
<?php
|
||||
// -------------------------------------------
|
||||
// kirby snippet GENERAL
|
||||
// Title: plg-carousel
|
||||
// funct: twitter bootstap carousel for photos in carousel subpage (folder)
|
||||
// modified for bootstrap 4 !
|
||||
|
||||
// copyright: Jannik Beyerstedt | http://jannikbeyerstedt.de | code@jannikbeyerstedt.de
|
||||
// license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
|
||||
|
||||
// usage:
|
||||
// snippet('plg-carousel', array('currentPage'=>$page,
|
||||
// 'preNormal'=>'optional html to add before carousel',
|
||||
// 'preAlt'=>'html if snippet is not displayed (for other styles)'))
|
||||
|
||||
// and set these constants in config.php:
|
||||
//c::set('plg_carousel.sort', 'sort'); // sortBy parameter: sort, title, etc.
|
||||
//c::set('plg_carousel.dir', 'asc'); // sortBy direction: asc, desc
|
||||
// -------------------------------------------
|
||||
|
||||
// display carousel only if there are images
|
||||
$carouselFolder = $currentPage->children()->find('carousel');
|
||||
if (!isset($preNormal)) {$preNormal="";}
|
||||
if (!isset($preAlt)) {$preAlt="";}
|
||||
$sort = c::get('plg_carousel.sort', 'title');
|
||||
$sdir = c::get('plg_carousel.dir', 'desc');
|
||||
|
||||
// if folder exists
|
||||
if (!(false==$carouselFolder) && ($carouselFolder->hasImages())) : echo $preNormal
|
||||
?>
|
||||
|
||||
<div id="myCarousel" class="carousel slide" data-ride="carousel">
|
||||
|
||||
<!-- Indicators -->
|
||||
<ol class="carousel-indicators">
|
||||
<?php $n=-1; foreach($carouselFolder->images()->sortBy($sort, $sdir) as $image): $n++; ?>
|
||||
<li data-target="#myCarousel" data-slide-to="<?php echo $n ?>" class="<?php if($n==0) echo ' active' ?>"></li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
|
||||
<div class="carousel-inner" role="listbox">
|
||||
<?php $n=-1; foreach($carouselFolder->images()->sortBy($sort, $sdir) as $image): $n++; ?>
|
||||
<div class="carousel-item<?php if($n==0) echo ' active' ?>">
|
||||
<img src="<?php echo $image->url() ?>" alt="<?php echo $image->title()->html() ?>" />
|
||||
<?php if(($image->heading() != "") || ($image->caption() != "")) : ?>
|
||||
<div class="carousel-caption">
|
||||
<?php if($image->heading() != "") : ?><h3><?php echo $image->heading()->kirbytext() ?></h3><?php endif; ?>
|
||||
<?php echo $image->caption()->kirbytext() ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php else : echo $preAlt ?>
|
||||
|
||||
<?php endif ?>
|
Loading…
Add table
Add a link
Reference in a new issue