Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Kirby is a file-based CMS. Parent comment
So this logic can go on a template or snippet:
<?php $latest = page('blog')->children()->visible()->limit(6); ?> <div class="widget"> <?php foreach($latest as $post) : ?> <a href="<?= $post->url()?>"><h2><?= $post->title()->html() ?></h2></a> <?php endforeach ?> </div>
There are no comments on this comment yet.
So this logic can go on a template or snippet:
Instead of fetching the post on the template, you could use a controller and just pass the $latest variable to the template.