PagesEditor::editor method

Sort one page before another (for pages using manual sort)

Note that if given $sibling parent is different from $page parent, then the $pages->save() method will also be called to perform that movement.

Usage

// basic usage
$pages->editor->insertBefore(Page $page, Page $sibling);

// usage with all arguments
$pages->editor->insertBefore(Page $page, Page $sibling, bool $after = false);

Arguments

NameType(s)Description
$pagePage

Page to move/sort

$siblingPage

Sibling that page will be moved/sorted before

$after (optional)bool

Specify true to make $page move after $sibling instead of before Default:false

Exceptions

Method can throw exceptions on error:

  • WireException - When conditions don't allow page insertions


$pages->editor methods and properties

API reference based on ProcessWire core version 3.0.252