Skip to content

Kirby 5.0.2

$page->isChildOf()

Checks if the page is a child of the given page

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

Parameters

Name Type Default
$parentrequired Kirby\Cms\Pageorstring no default value

Return type

bool

Parent class

Kirby\Cms\Page

Examples

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