Hi all -
Please bare with me, but I’m trying to get my first Kirby site running and am hitting what is probably a simple issue.
I’ve used the ‘starter kit’ and am trying to create a ‘Case Studies’ category and page. I’ve managed to do it, but I can’t loop any subpages on the case study template landing page.
I’ve used the the ‘showcase.php’ snippet that came with starter kit, but have changed it to be:
<?php $casestudies = page('casestudies')->children()->visible(); if(isset($limit)) $casestudies = $casestudies->limit($limit); ?> <ul class="showcase grid gutter-1"> <?php foreach($casestudies as $casestudy): ?> <li class="showcase-item column"> <a href="<?= $casestudy->url() ?>" class="showcase-link"> <?php if($image = $casestudy->images()->sortBy('sort', 'asc')->first()): $thumb = $image->crop(600, 600); ?> <img src="<?= $thumb->url() ?>" alt="Thumbnail for <?= $casestudy->title()->html() ?>" class="showcase-image" /> <?php endif ?> <div class="showcase-caption"> <h3 class="showcase-title"><?= $casestudy->title()->html() ?></h3> </div> </a> </li> <?php endforeach ?> </ul>
But nothing is showing. Please note that I’ve also removed dashes in ‘case-study’ in case that was causing an issue, and have tried using it as all one word.
What exactly are the $casestudy and $casetudies variables in the snippet referencing? If I need to paste any other code or show folder structure please let me know.
Thanks for you patience!