$pid = 123; // Page ID of the record you want to retrieve $uid = 456; // UID of the record you want to retrieve $table = 'tx_myextension_domain_model_record'; // Table name of the record you want to retrieve $record = BackendUtility::getLiveVersionOfRecord($table, $uid, 'pid=' . $pid); // The $record variable now contains the live version of the record for the given page and UID
$pageId = $GLOBALS['TSFE']->id; // Get the current page ID $contentElementUid = $GLOBALS['TSFE']->contentUid; // Get the UID of the current content element $record = BackendUtility::getLiveVersionOfRecord('tt_content', $contentElementUid, 'pid=' . $pageId); // The $record variable now contains the live version of the current content elementIn this example, the function is used to retrieve the live version of the current content element being displayed on the front-end of the website. The BackendUtility class is part of the TYPO3 CMS Core package library.