Skip to content

Kirby 3.7.5

$page->siblings()

Returns all sibling elements

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

Parameters

Name Type Default
$self bool true

Return type

Kirby\Cms\Collection

Parent class

Kirby\Cms\Page

Example

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