Reference

$page->isChildOf()

Checks if the page is a child of the given page

$page->isChildOf(string|\Page $parent): bool

Parameters

Name Type Default Description
$parent string|\Page

Return type

bool

Example

<?php if($page->isChildOf('some-parent-page')): ?>
This page is a child of it's parent!
<?php endif ?>

Source code

kirby/src/Cms/Page.php#L598