Fetch collection of pages without isOpen() page

Hello,

how to fetch a collection of pages without the active page ?
isNotOpen() do not exist
I could do an if query within the foreach loop but that would not be so nice.

    <?php foreach($site->find($source)->children()->visible()->flip()->limit($children_limit)->isNotOpen() as $items): ?>

Try:

$nonActivePages  = $site->find($source)->children()->visible()->filter(function($child) {
  return $child->isOpen() === false;
})->flip()->limit($children_limit);

Error output:
Undefined variable: page

maybe because I use this:

   <?php
          snippet('news',
          array('children_limit' => '6','source'=>'angebote'))
        ?>

Should be $child, of course, inside the callback, corrected above.

Thank you @texnixe !
:grinning: