getParent

API Function Definition
Access Private
Available since Unknown
Returns Array

function getParent($id=-1, $active=1, $fields='id, pagetitle, description, alias, parent');

Usage / Examples

$parent = $modx->getParent(55,1,'pagetitle');

will return the title of the parent of document 55 if the parent is published.

$parent = $modx->getParent(55,0,'id');

will return the parent document's id if it is not published.

Suggest an edit to this page.