TYPO3: Set extension record title as page title

For the records such as News or the custom extension elements, on the detail page, we often need to set the record title as the page title for the SEO purpose. We can do that using the following code

 

$GLOBALS['TSFE']->page['title'] = $project->getTitile();

$GLOBALS['TSFE']->page['description'] = $project->getDescription();