Next Previous link with filter

It’s possible with these two custom methods:


They allow you to pass the filtered collection as first argument.

<?php
$siblings = $page->siblings()->visible()->filterBy('template', '==', 'blogarticle')->unscheduled();
 if($previous = $page->getPrev($siblings)): ?>
    <a href="<?= $previous->url() ?>">previous articles</a>
<?php endif ?>