$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
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();
}