$page->isChildOf()
Checks if the page is a child of the given page
$page->isChildOf(Page|string $parent): bool
Parameters
| Name | Type | Default |
|---|---|---|
| $parentrequired | Kirby\Cms\Pageorstring |
no default value |
Return type
bool
Parent class
Examples
<?php if ($page->isChildOf('some-parent-page')): ?>
This page is a child of it's parent!
<?php endif ?>