Feature: #54887 - Post-processing of the previewUrl

See forge#54887

Description

An additional hook has been added to the method BackendUtility::viewOnClick() to post-process the preview url.

The hook is called with the following signature:

/**
 * @param string $previewUrl
 * @param int $pageUid
 * @param array $rootLine
 * @param string $anchorSection
 * @param string $viewScript
 * @param string $additionalGetVars
 * @param bool $switchFocus
 * @return string The processed preview URL
 */
function postProcess($previewUrl, $pageUid, $rootLine, $anchorSection, $viewScript, $additionalGetVars, $switchFocus)
Copied!

Register the hook

Register a hook class which implements the method with the name postProcess:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass'][] = \VENDOR\MyExt\Hooks\BackendUtilityHook::class;
Copied!