Skip to content

Kirby 4.4.1

$site->hasListedChildren()

Checks if the page has any listed children

$site->hasListedChildren(): bool

Return type

bool

Parent class

Kirby\Cms\Site

Example

<?php if($site->hasListedChildren()): ?>
    <nav>
    <?php foreach ($site->children()->listed() as $child): ?>
        <a href="<?= $child->url() ?>"><?= $child->title() ?></a>
    <?php endforeach ?>
    </nav>
<?php endif ?>