$site->pages()

Returns a $pages collection for all direct children in /content. It's an old version of $site->children()

  • return ($pages)

Example

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

Is something missing or incorrect? Edit this page on Github…