Hi everyone
I’m trying to fetch blog articles from page B on page A using the collection feature. I get an error when trying this on page A:
<?php foreach($kirby->collections('articles') as $article): ?>
<article>
<h1><?= $article->title()->html() ?></h1>
<p><?= $article->text()->excerpt(300) ?></p>
<a href="<?= $article->url() ?>">Read more…</a>
</article>
<?php endforeach ?>
I have file articles.php in the folder Collections like this:
return function ($site) {
return $site->find('pageB')->children()->listed()->flip();
};
What am I doing wrong?
(debug mode isn’t working on my local machine)