Skip to content

Kirby 3.9.8

$page->children()

Returns all published children

$page->children(): Kirby\Cms\Pages

Return type

Kirby\Cms\Pages

Parent class

Kirby\Cms\Page

Example

<h2>Subpages</h2>
<ul>
  <?php foreach($page->children() as $subpage): ?>
  <li>
    <a href="<?= $subpage->url() ?>">
      <?= html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>