???
$z = $modx->documentObject['pagetitle'];
) confused you. I answered the question in the message subject without stopping to think that pagetitle wasn’t a placeholder.$your_variable = $modx->documentObject['pagetitle'];