Hi,
das Template funzt für alle Galerie Elemente.
So sieht das ganze aus.
Das Template geht mit jeder Galerie, auch mit dem Galerie Attribut von CE.
das Template funzt für alle Galerie Elemente.
So sieht das ganze aus.
Das Template geht mit jeder Galerie, auch mit dem Galerie Attribut von CE.
PHP-Code:
<?php // include jquery and nivoslider scripts
global $objPage;
if(!$objPage->hasJQuery)
{
$GLOBALS['TL_JAVASCRIPT'][] = '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js';
}
$GLOBALS['TL_JAVASCRIPT'][] = 'files/cto_layout/scripts/nivoslider/jquery.nivo.slider.js';
$GLOBALS['TL_CSS'][] = 'files/cto_layout/scripts/nivoslider/nivo-slider.css';
$GLOBALS['TL_CSS'][] = 'files/cto_layout/scripts/nivoslider/themes/default/default.css';
?>
<div class="nivoslider_wrapper">
<div class="nivoslider_<?php echo $this->id; ?> nivoSlider">
<?php foreach ($this->body as $class=>$row): ?>
<?php foreach ($row as $col): ?>
<?php if ($col->addImage && $col->src): ?>
<?php if ($col->href): ?>
<a href="<?= $col->href ?>"<?= $col->attributes ?> title="<?= $col->alt ?>">
<?php endif; ?>
<?php if(version_compare(VERSION, '3.5','>=')): ?>
<?php $this->insert('picture_nivoslider_thumb', $col->picture); ?>
<?php else: ?>
<?php // generate a thumbnail
$thumb = \Controller::getImage($col->src,'50','50','center_center');
?>
<img src="<?php echo $col->src; ?>"<?php echo $col->imgSize; ?> alt="<?php echo $col->alt; ?>" title="<?php echo $col->caption; ?>" data-thumb="<?php echo $thumb; ?>">
<?php endif;?>
<?php endif; ?>
<?php if($col->href): ?>
</a>
<?php endif;?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
<div id="htmlcaption" class="nivo-html-caption caption"><?php echo $col->caption; ?></div>
</div>
<script type="text/javascript">
/* <![CDATA[ */
/**
* Nivoslider
* @doc: http://docs.dev7studios.com/jquery-plugins/nivo-slider
*/
jQuery(document).ready(function()
{
jQuery('.nivoslider_<?php echo $this->id; ?>').nivoSlider(
{
effect: 'random', // Specify sets like: 'fold,fade,sliceDown'
slices: 15, // For slice animations
boxCols: 8, // For box animations
boxRows: 4, // For box animations
animSpeed: 500, // Slide transition speed
pauseTime: 3000, // How long each slide will show
startSlide: 0, // Set starting Slide (0 index)
directionNav: true, // Next & Prev navigation
controlNav: true, // 1,2,3... navigation
controlNavThumbs: true, // Use thumbnails for Control Nav
pauseOnHover: true, // Stop animation while hovering
manualAdvance: true, // Force manual transitions
prevText: 'Prev', // Prev directionNav text
nextText: 'Next', // Next directionNav text
randomStart: false, // Start on a random slide
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){}, // Triggers after all slides have been shown
lastSlide: function(){}, // Triggers when last slide is shown
afterLoad: function(){} // Triggers when slider has loaded
});
});
/* ]]> */
</script>
Kommentar