$page->isAncestorOf()
Checks if the page is a direct or indirect ancestor of the given $page object
$page->isAncestorOf(Kirby\Cms\Page $child): bool
Parameters
Name | Type | Default |
---|---|---|
$child * | Kirby\Cms\Page |
– |
Return type
bool
Parent class
Example
<?php if($page->isAncestorOf('some-child-page')): ?>
This page is an ancestor of the given page.
<?php endif ?>