Get pages between two numbers


Is something getting pages between two numbers like this possible?

   <?php foreach ($site->children()->not("home", "xy")->listed()->filterBy("between", 3, 6) as $page): ?>
         <?= $page->title()->upper()->link() ?>
  <?php endforeach ?>


What do you mean?

  1. Between 2 “indexes” in the pages collection? Then slice() can help.
  2. Some kind of field which is in between 2 values? Then filter() can help.
1 Like

Ah, thanks, I didn’t find the slice possibility.
Thanks and have a nice day!