Feature: #108866 - Page record object in frontend page information 

See forge#108866

Description 

The frontend request attribute frontend.page.information , an instance of \TYPO3\CMS\Frontend\Page\PageInformation , provides the new method getRecord() . It returns the current page as record object implementing \TYPO3\CMS\Core\Domain\RecordInterface , created by the Record API from the same page row getPageRecord() returns. The row is the final one of the request: it reflects resolved shortcuts and mount points, and on a translated page it is the language overlay. As with getPageRecord() , getUid() returns the uid of the page in the default language, the uid of the translation is available via getComputedProperties()->getLocalizedUid() .

Like other resolved records, its fields are transformed according to their TCA configuration, for example relations such as media are resolved to file references. Only the fields of the page type are available, system fields such as crdate or starttime are not. Use getPageRecord() or {page.pageRecord.crdate} for those. The record is created once the page and language are resolved, after the event \TYPO3\CMS\Frontend\Event\AfterPageAndLanguageIsResolvedEvent . Relations are resolved lazily on first access.

$page = $request->getAttribute('frontend.page.information')->getRecord();
$title = $page->get('title');
Copied!

In Fluid templates rendered by PAGEVIEW , the record is available via the page variable:

<h1>{page.record.title}</h1>
<f:for each="{page.record.media}" as="image">
    <f:image image="{image}" />
</f:for>
Copied!

getPageRecord() continues to return the page row as array.

Impact 

Extensions and templates can access the current frontend page as record object with resolved relations, without creating it from the page row themselves.