$pages->shuffle()

Shuffles all items in the collection

  • return ($pages)

Example

<h2>Random subpages</h2>
<ul>
  <?php foreach($page->children()->shuffle() as $subpage): ?>
  <li>
    <a href="<?= $subpage->url() ?>">
      <?= html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>