[SITE] add template, blueprint, css for photo pages
This commit is contained in:
parent
e810aa8071
commit
c79ea83e0d
20 changed files with 542 additions and 705 deletions
|
@ -12,6 +12,7 @@
|
|||
<?php
|
||||
echo js('assets/vendors/bootstrap/js/dist/util.js');
|
||||
echo js('assets/vendors/bootstrap/js/dist/collapse.js');
|
||||
echo js('assets/vendors/bootstrap/js/dist/carousel.js');
|
||||
?>
|
||||
|
||||
<?php if (c::get('navbar-affix')) : ?>
|
||||
|
@ -32,14 +33,6 @@ echo js('assets/vendors/bootstrap/js/dist/collapse.js');
|
|||
echo js('assets/vendors/swipebox/src/js/jquery.swipebox.min.js');
|
||||
}?>
|
||||
|
||||
<?php if (c::get('plg_carousel.enable')) : ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('.carousel').carousel('cycle');
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ((c::get('plg_masonry.lightbox')=='swipebox')) : ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
|
58
site/snippets/plg-carousel.php
Normal file
58
site/snippets/plg-carousel.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?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() ?>" />
|
||||
<div class="carousel-caption">
|
||||
<h3><?php echo $image->heading()->kirbytext() ?></h3>
|
||||
<?php echo $image->caption()->kirbytext() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
|
||||
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
|
||||
</div>
|
||||
|
||||
<?php else : echo $preAlt ?>
|
||||
|
||||
<?php endif ?>
|
Loading…
Add table
Add a link
Reference in a new issue