Reference

Guide

$page->isOpen()

Checks if the page is open.

$page->isOpen(): bool

Return type

bool

Example

<nav role="navigation">
  <ul>
    <?php foreach($pages as $subpage): ?>
    <li<?php e($subpage->isOpen(), ' class="active"') ?>>
      <a href="<?= $subpage->url() ?>">
        <?= html($subpage->title()) ?>
      </a>
    </li>
    <?php endforeach ?>
  </ul>
</nav>

Source code

kirby/src/Cms/Page.php#L749