Reference

Guide

$page->find()

Finds one or multiple children by id

$page->find(string $arguments = null): Kirby\Cms\Page|Kirby\Cms\Pages

Parameters

Name Type Default Description
$arguments string null

Return type

Kirby\Cms\Page|Kirby\Cms\Pages

Example

Fetch a single subpage

<?= $page->find('subpage-a')->title() ?>

Fetch multiple subpages

<ul>
  <?php foreach($page->find('subpage-a', 'subpage-c', 'subpage-i') as $subpage): ?>
  <li>
    <a href="<?= $subpage->url() ?>">
      <?= html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>

Source code

kirby/src/Cms/HasChildren.php#L131