Don't show current page

I have a collection:

<?php

return function ($site) {
    return $site->find('wie-zijn-wij')->children();
};

I am using this collection on a child page of “wie zijn wij”

<?php foreach ($kirby->collection('wie-zijn-wij') as $teammember): ?>
    <div class="mask h-full">
        <div class="border border-brand-neutral-300 rounded-2xl h-full flex flex-col lg:justify-between lg:flex-row overflow-hidden">
            <div class="p-10 flex flex-col flex-nowrap justify-items-start items-start">
                <h4 class="font-primary text-2xl text-brand-neutral-900 font-bold mb-4"><?= $teammember->name() ?></h4>
                <p class="font-primary text-brand-neutral-500 text-xl flex-1"><?= $teammember->description() ?></p>
                
                <a class="group animate-top-bottom btn-quaternary mt-12" href="<?= $teammember->url() ?>">
                    <div class="btn-container button-children">
                        <span>Meer info</span>
                        <svg class="fill-brand-neutral-50 group-hover:fill-brand-neutral-900" width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <path d="M8.46967 1.53033C8.17678 1.23744 8.17678 0.762563 8.46967 0.46967C8.76256 0.176777 9.23744 0.176777 9.53033 0.46967L13.5303 4.46967C13.8232 4.76256 13.8232 5.23744 13.5303 5.53033L9.53033 9.53033C9.23744 9.82322 8.76256 9.82322 8.46967 9.53033C8.17678 9.23744 8.17678 8.76256 8.46967 8.46967L11.1893 5.75H1.5C1.08579 5.75 0.75 5.41421 0.75 5C0.75 4.58579 1.08579 4.25 1.5 4.25H11.1893L8.46967 1.53033Z"/>
                        </svg>
                    </div>
                </a>
            </div>
            <?php if($image = $teammember->imagethumb()->toFile()): ?>
                <img src="<?= $image->url() ?>">
            <?php endif ?>
        </div>
    </div>
<?php endforeach ?>

But I want al children to show EXCEPT the current page where I am at (the child page that we are viewing this from).

How do this?

Two options:

  1. Use $page->siblings(false) instead.
  2. Exclude the current page from the collection:
    $kirby->collection('wie-zijn-wij')->not($page)
    
1 Like

Thanx! :slight_smile: