Reference

$page->siblings()

Returns all sibling elements

$page->siblings(bool $self = true): Collection

Parameters

Name Type Default Description
$self bool true

Return type

Collection

Example

<?php
$siblings = $page->siblings();
foreach($siblings as $sibling): ?>
  <h1><?= $sibling->title()->html() ?></h1>
<?php endforeach ?>

Source code

kirby/src/Cms/HasSiblings.php#L73