Reference

Guide

$page->isDescendantOfActive()

Checks if the page is a descendant of the currently active page

$page->isDescendantOfActive(): bool

Return type

bool

Example

<?php if($page->isDescendantOfActive()): ?>
This page is a descendant of the currently active page.
<?php endif ?>

Source code

kirby/src/Cms/Page.php#L667