Hi all, for the first time I’ve created a one-pager with two-language setup (English/Korean). The basic structure scrolls to three main ids.
First Question:
In the second , I only want the first image from this $event to display, but while I manually reorder the files in /panel using drag and drop, and call them at the front-end, it does not reflect the order in /panel. Like the boilerplate one-pager example, these are wrapped in an unordered-list.
Second Question:
If there is no image to accompany the li, my code breaks, since the figure is looking for an img. I’m wondering how to re-write this as a conditional call, so that if there is no image for the $event, its not a problem.
<?php foreach($data->children()->visible() as $event): ?>
<li class="make-block decompose-lines">
<h1>
<?php echo $event->artist()->kirbytext() ?>
<?php echo $event->artwork()->kirbytext() ?>
</h1>
<?php echo $event->text()->kirbytext() ?>
<figure class="make-block decompose-lines">
<img src="<?php echo $event->images()->first()->url() ?>" alt="<?php echo $event->title()->html() ?>" />
</figure>
</li>
<?php endforeach ?>
Thank you very much!