I’m using a structure field to build a timeline on my website. I would need to show multiple images (with a slider) for each event of the timeline. This is my code so far for a single image for each event:
<?php
$events = $page->events()->yaml();
foreach($events as $event): ?>
<dl>
<dd class="pos-<?php echo $event['positie'] ?> clearfix">
<div class="circ"></div>
<div class="time">
<?php $somedate = $event['event_datum']; echo date('M Y', strtotime($somedate)) ?>
</div>
<div class="events">
<div class="events-header"><?php echo $event['event_titel'] ?></div>
<div class="events-body">
<?php if($image = $page->image($event['event_beeld'])) echo thumb($image, array('width' => 200, 'height' => 150, 'crop' => true)); ?>
<div class="events-desc">
<?php echo $event['event_tekst'] ?>
</div>
</div>
</div>
</dd>
</dl>
<?php endforeach ?>
My blueprint:
fields:
event_datum:
label: Datum
type: date
event_titel:
label: Titel
type: text
event_tekst:
label: Tekst
type: textarea
event_beeld:
label: Afbeelding
type: image
I would like to use the ‘images’ field of this plugin: https://github.com/medienbaecker/kirby-images
Is this possible and could you help me on my way to accomplish this? Thank you for your help.