$page->nextUnlisted()
Returns the next unlisted page if it exists
$page->nextUnlisted(Kirby\Cms\Pages|null $collection = null): Kirby\Cms\Page|null
Parameters
Name | Type | Default |
---|---|---|
$collection | Kirby\Cms\Pages ornull |
null
|
Return types
Kirby\Cms\Page
ornull
This method modifies the existing $page
object it is applied to and returns it again.
Parent class
Examples
<?php if ($next = $page->nextUnlisted()): ?>
<a href="<?= $next->url() ?>">next unlisted page</a>
<?php endif ?>
Pass a collection
<?php
$collection = $page->siblings()->unlisted()->sortBy('date', 'desc');
if ($next = $page->nextUnlisted($collection)): ?>
<a href="<?= $next->url() ?>">next unlisted page</a>
<?php endif ?>