$page->find($uri)

Returns the $page object of a specific subpage by URI. If multiple URIs are given, the method will return a $pages collection with all matches.

  • $uri (args)
    The URI(s) of a subpage or multiple subpages
  • return ($page | $pages)

Example

Fetch a single subpage

<?= $page->find('subpage-a')->title() ?>

Fetch multiple subpages

<ul>
  <?php foreach($page->find('subpage-a', 'subpage-c', 'subpage-i') as $subpage): ?>
  <li>
    <a href="<?= $subpage->url() ?>">
      <?= html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>

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