Skip to content

Kirby 3.6.6

$page->hasNextUnlisted()

Checks if there's a next unlisted page in the siblings collection

$page->hasNextUnlisted(\Kirby\Cms\Collection|null $collection = null): bool

Parameters

Name Type Default
$collection Kirby\Cms\Collection|null null

Return type

bool

Parent class

Kirby\Cms\Page

Example

if ($page->hasNextUnlisted()) {
  echo $page->nextUnlisted()->url();
}

With collection as argument

$collection = $page->siblings()->unlisted()->sortBy('date', 'desc');
if ($page->hasNextUnlisted($collection)) {
  echo $page->nextUnlisted($collection)->url();
}