$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="<?php echo $subpage->url() ?>">
      <?php echo html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>