Skip to content

Kirby 3.9.8

$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
$parent * Kirby\Cms\Page|string

Return type

bool

Parent class

Kirby\Cms\Page

Example

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