Skip to content

Kirby 5.1.1

$page->parent()

Returns the parent Page object

$page->parent(): Kirby\Cms\Page|null

Return types

Kirby\Cms\Pageornull

This method modifies the existing $page object it is applied to and returns it again.

Parent class

Kirby\Cms\Page

Examples

This page is a subpage of:

<a href="<?= $page->parent()->url() ?>">
  <?= html($page->parent()->title()) ?>
</a>