$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

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

Fetch multiple subpages

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