$page->hasPrevUnlisted()
Checks if there's a previous unlisted page in the siblings collection
$page->hasPrevUnlisted(Kirby\Cms\Pages|null $collection = null): bool
Parameters
Name | Type | Default |
---|---|---|
$collection | Kirby\Cms\Pages ornull |
null
|
Return type
bool
This method modifies the existing $page
object it is applied to and returns it again.
Parent class
Examples
if ($page->hasPrevUnlisted()) {
echo $page->prevUnlisted()->url();
}
With collection as argument
$collection = $page->siblings()->unlisted()->sortBy('date', 'desc');
if ($page->hasPrevUnlisted($collection)) {
echo $page->prevUnlisted($collection)->url();
}