In the same category, how to list the other articles and except self?

One article page in the same category, how to list the other articles?
Now I want list 5 articles and except self.

<?php foreach($page->parent()->children()->limit(5) as $item): ?>
...
<?php endforeach ?>

How to except self?
Or who has a better idea, Thanks!

You can use the siblings() method with the self parameter set to false:

<?php foreach($page->siblings(false)->limit(5) as $item): ?>
...
<?php endforeach ?>
1 Like

Thanks texnixe!
By the way, the Kirby’s API and Processwire’s API are almost the same in many places, is this coincidence?
I really like this API, too convenient!

Probably similar because it’s logical, after all the same sort of objects like pages, images, collections etc. have the same kind of properties (titles, images, children, fields etc.).