Hi, this is my first post here so please bear with me.
I am trying to use Kirby’s
$file->prev() function (see here) to access the previous image in a foreach loop. The problem is that the function seems to ignore the manual sorting parameter and instead sorts by filename. Any idea what I could be missing/doing wrong?
<?php foreach($page->images()->sortBy('sort', 'asc')->offset(1) as $image): ?> <p> Previous image: <?= $image->prev()->filename(); ?><br> This image: <?= $image->filename() ?> </p> <?php endforeach ?>