Reference

$page->sort()

$page->sort($position = null): /docs/reference/objects/file/asset

Parameters

Name Type Default Description
$position mixed null

Return type

/docs/reference/objects/file/asset

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#L594