I am trying to work out the best way of comparing the content of a pages field and a collection of pages.
Below is my rough outline of what I am trying to achieve:
<?php
$userPages = $kirby->user()->progressDetails()->toPages();
$pages = $site->find('pages')->children();
foreach($pages as $page):
?>
// Here I want to list all the pages in their normal order, but do something different with them if they also appear in the progressDetails pages field for the user
<?php
endforeach;
?>
Thanks for the quick reply! I can’t get this to work, I am probably implementing it wrong.
I have this:
<?php foreach($pages as $page): ?>
<div>
<?php if($userPages->has($page)): ?>
The user has found <?= $page->title() ?>
<?php else: ?>
Not found <?= $page->title() ?>
<?php endif ?>
</div>
<?php endforeach ?>
All the pages are coming up as Not found though - I have a few pages selected in the field.