Deprecation: #88499 - BackendUtility::getViewDomain¶
The static method
TYPO3\CMS\Backend\Utility\BackendUtility::getViewDomain() has been marked
as deprecated, as it has been superseded by directly using the PageRouter of Site Handling.
Site Handling allows to generate proper frontend preview URLs the same way as TYPO3 Core does in all other places, by calling the PageRouter of a Site object directly, so the workarounds are not necessary anymore, making this method obsolete.
BackendUtility::getViewDomain() will trigger a PHP
Any TYPO3 installations with custom extensions that call this method.
Substitute the method by directly detecting a site based on a given Page ID in the TYPO3 Backend.
getRouter() method on this Site object to create proper links to pages in TYPO3 Frontend.
Example with additional GET parameters:
$site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId($pageId); $url = $site->getRouter()->generateUri($pageId, ['type' => 13]);