slider:
label: Add Slide
type: structure
entry: >
{{title}} <br/> {{text}}
fields:
title:
label: Slide Title
type: textarea
text:
label: Slide Description
type: textarea
bgimage:
label: Slide Background Image
type: image
buttonname:
label: Button Name
type: text
width: 1/3
buttonlink:
label: Button Link
type: url
width: 2/3
parallaximages:
label: Slideshow
type: images
<?php foreach($module->slider()->toStructure() as $slide): ?>
<?php if($sliderimage = $slide->bgimage()->toFile()): ?>
<div style="background-image: url('<?= $sliderimage->url() ?>')" class="action-slider__slide action-slider__slide--google">
<div class="action-slider__slide-wrapper container">
<div class="action-slider__info">
<?php if(!$slide->title()->empty()): ?>
<div class="action-slider__caption"><span><?= $slide->title()->kirbytextRaw() ?></span> </div>
<?php endif ?>
<?php if(!$slide->text()->empty()): ?>
<div class="action-slider__description"><?= $slide->text()->kirbytextRaw() ?> </div>
<?php endif ?>
<?php if(!$slide->buttonname()->empty()): ?>
<a href="<?= $slide->buttonlink()->html() ?>" class="action-slider__btn"><?= $slide->buttonname()->html() ?></a>
<?php endif ?>
</div>
<div id="parallax-7" class="action-slider__parallax">
<div class="action-slider__img-group">
<?php foreach($slide->parallaximages()->yaml() as $image): ?>
<?php if($img = $slide->image($image)): ?>
<div data-depth=".18" class="action-slider__img-holder action-slider__img-holder--1 layer">
<img src="<?= $img->url() ?>" alt="" class="action-slider__img">
</div>
<?php endif ?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php endif ?>
<?php endforeach ?>
If the above doesn’t work, try:
<?php if($sliderimage = $module->image($slide->bgimage()): ?>
Hey Texnixe
Than you so much for your answer
My problem with that;
<?php foreach($slide->parallaximages()->yaml() as $image): ?>
<?php if($img = $slide->image($image)): ?>
<div data-depth=".18" class="action-slider__img-holder action-slider__img-holder--1 layer">
<img src="<?= $img->url() ?>" alt="" class="action-slider__img">
</div>
<?php endif ?>
<?php endforeach; ?>
What plugin is that?
Kirby Images
Ok, still, try to get the image via the module:
<?php if($img = $module->image($image)): ?>
Wow men… I am really stupid
Thank you so much. It works