$site->find()
Finds one or multiple published children by ID
$site->find(array|string ...$arguments): Kirby\Cms\Page|Kirby\Cms\Pages|null
Parameters
Name | Type | Default |
---|---|---|
...$arguments | array orstring |
no default value |
Return types
Kirby\Cms\Page
orKirby\Cms\Pages
ornull
This method modifies the existing $site
object it is applied to and returns it again.
Parent class
Examples
Fetch a single subpage
<?= $site->find('subpage-a')->title() ?>
Fetch multiple subpages
<ul>
<?php foreach($site->find('subpage-a', 'subpage-c', 'subpage-i') as $subpage): ?>
<li>
<a href="<?= $subpage->url() ?>">
<?= html($subpage->title()) ?>
</a>
</li>
<?php endforeach ?>
</ul>