Skip to content

Kirby 5.4.0

$page->changeNum()

Changes the sorting number. Low-level method, ensure to run all necessary checks (e.g. permissions) before calling it. The sorting number must already be correct when the method is called. This only affects this page, siblings will not be resorted.

$page->changeNum(int|null $num = null): Kirby\Cms\Page

Parameters

Name Type Default
$num intornull null

Return types

Kirby\Cms\Page

This method does not modify the existing $page object but returns a new object with the changes applied. Learn more →

Exceptions

Type Description
Kirby\Exception\LogicException If a draft is being sorted or the directory cannot be moved

Parent class

Kirby\Cms\Page