$page->nextVisible([$sort, $direction])

Returns the next visible sibling

  • $sort (string)
    An optional sort field for the siblings
  • $direction (string)
    An optional sort direction
  • return ($page)

Example

<?php if($next = $page->nextVisible()): ?>
<a href="<?= $next->url() ?>">next visible page</a>
<?php endif ?>

Using sort field

<?php if($next = $page->nextVisible('title', 'asc')): ?>
<a href="<?= $next->url() ?>">next visible page</a>
<?php endif ?>