It would be useful to have things like [[*parent:pagetitle]] available ... is there something like that? Admittedly, it’s an easy snippet to add, so not a super high priority as a built in, but it could be handy.
If you use it a lot, you could make it a custom output modifier (but watch out, resources at the root don’t have a parent with a pagetitle, so trying to get it would throw a PHP error).
<?php
/* GetParentName snippet */
if ($resource->get('parent')) {
$parent = $modx->getObject('modResource',$modx->resource->get('parent'));
return $parent->get('pagetitle');
} else {
return 'site-root';
}
Looks good, although I wouldn’t use pagetitle for the name of the snippet/modifier. It makes me uneasy to use the name of a resource field for an element or variable name and there might be an output modifier with that name someday that does something else.