Reference

Guide

$page->sort()

$page->sort($position = null)

Parameters

Name Type Default Description
$position null

Example

try {

  page('invisible-page')->sort(12);
  echo 'The page is now visible and has the sorting number 12';

} catch(Exception $e) {

  echo $e->getMessage();

}

No parameter

If the parameter $num is not specified, the result of `$page->num() will be returned instead.

Source code

kirby/src/Cms/PageActions.php#L715