I have the following definition of $articles:
$articles = $page->children()->filter(function ($child) {
return $child->translation(kirby()->language()->code())->exists();
})->listed()->flip();
$articles = $articles->paginate(6);
$pagination = $articles->pagination();
return compact('articles', 'tags', 'tag', 'pagination');
In a sidebar I want to display all pages that have the blueprint field featured = true:
<?php foreach ($articles as $article): ?>
<?php if($article->featured()->toBool()): ?>
<?php endif ?>
<?php endforeach ?>
This works as long as all featured pages are on the current page but as soon as a featured page is on another page (let’s say on page 2 while I am on page 1) they don’t appear in the sidebar.
Why is that and how can I fix it?