Skip to content

Instantly share code, notes, and snippets.

@splittingred
Created September 26, 2011 18:57
Show Gist options
  • Save splittingred/1243042 to your computer and use it in GitHub Desktop.
Save splittingred/1243042 to your computer and use it in GitHub Desktop.
Gets a pagetitle of a specified resource
<?php
$id = $modx->getOption('id',$scriptProperties,$modx->resource->get('id'));
$pageTitle = '';
$resource = $modx->getObject('modResource',$id);
if ($resource) {
$pageTitle = $resource->get('pagetitle');
}
return $pageTitle;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment