Page Utility

Doing Page (and Pagetree) related stuff.

class Jar\Utilities\Utilities\PageUtility

Jar\Utilities\Utilities\PageUtility::getPidsRecursive($pids, $level = 3)

Returns all Sub-Pids of certain PIDs.

Parameters
  • $pids (string) -- The starting PID.

  • $level (int) -- Depth of the traversing levels.

Returns

List of matching PIDs.

Example:

My little sweet page tree

var_dump(PageUtility::getPidsRecursive(1));
// ['1','2', '3', '7', '8', '4', '5', '9', '10', '6']

var_dump(PageUtility::getPidsRecursive(1, 1));
// ['1','2', '3', '4', '5', '6']

Jar\Utilities\Utilities\PageUtility::getPageFieldSlided($fieldname)

Slides up a the Pagetree (starting from the current page) and return the nearest filled value of the field.

Parameters
  • $fieldname (string) -- Name of the field/column.

Returns

Value of the field when found, otherwise "null".