$page->hasNextListed()
Checks if there's a next listed page in the siblings collection
$page->hasNextListed(Kirby\Cms\Pages|null $collection = null): bool
Parameters
Name | Type | Default |
---|---|---|
$collection | Kirby\Cms\Pages ornull |
null
|
Return type
bool
Parent class
Examples
if ($page->hasNextListed()) {
echo $page->nextListed()->url();
}
With collection as argument
$collection = $page->siblings()->listed()->sortBy('date', 'desc');
if ($page->hasNextListed($collection)) {
echo $page->nextListed($collection)->url();
}