Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here: TYPO3 ELTS.
Current content object
New in version 12.4
The Extbase-related method
\TYPO3\
was marked as deprecated in TYPO3 v12 and has been removed in TYPO3 v13.
Instead, this request attribute can be used to retrieve the current
content object.
Instances with Extbase controllers may need to retrieve data from the current content object that initiated the frontend Extbase plugin call.
In this case, controllers can access the current content object from the Extbase request object.
Example:
/**
* @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $currentContentObject
*/
$currentContentObject = $request->getAttribute('currentContentObject');
// ID of current tt_content record
$uid = $currentContentObject->data['uid'];