Skip to content

Kirby 3.8.4

$page->isDescendantOf()

Checks if the page is a descendant of the given page

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

Parameters

Name Type Default
$parent * Kirby\Cms\Page|string

Return type

bool

Parent class

Kirby\Cms\Page

Example

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