Get pages between two numbers

Hi!

Is something getting pages between two numbers like this possible?

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

Thanks!

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!