Hi, is there a way to select a few subpages by their position? For example, select first 5 pages or select pages 6 onwards?
Here’s the what I am trying to do. Thanks.
<ul class="top_block">
<?php
$topItems = $data->children()->listed(); //select only the first 5 pages
foreach ($topItems as $topItem): ?>
<li class="items_one_to_five">
<a href="<?= $topItem->link() ?>">
</a>
</li>
<?php endforeach ?>
</ul>
<ul class="bottom_block">
<?php
$items = $data->children()->listed(); //select all the rest
foreach ($items as $item): ?>
<li class="items_six_on">
<a href="<?= $item->link() ?>">
</a>
</li>
<?php endforeach ?>
</ul>