Reference

$page->isDescendantOf()

Checks if the page is a descendant of the given page

$page->isDescendantOf(Kirby\Cms\Page $parent): bool

Parameters

Name Type Default Description
$parent Kirby\Cms\Page

Return type

bool

Example

<?php if($page->isDescendantOf('some-page')): ?>
This page is a descendant of the given page.
<?php endif ?>

Source code

kirby/src/Cms/Page.php#L608