[FEATURE] Add option to set an alternative domain for preview 26/24626/8
authorJohannes Pieper <pieper@dlrg.de>
Sat, 12 Oct 2013 11:47:44 +0000 (13:47 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 14 Oct 2013 10:09:56 +0000 (12:09 +0200)
Make it possible to set an alternative domain for preview with
TCEMAIN.viewDomain = example.com
in PageTS. It is useful for multidomain sites.

Resolves: #30889
Documentation: #30889
Releases: 6.2
Change-Id: If00dabcd8c3c32685bd89707ba60f31be26a6dca
Reviewed-on: https://review.typo3.org/24626
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 38bcb57..fee13ba 100644 (file)
@@ -2661,7 +2661,12 @@ class BackendUtility {
                        if ($page['url_scheme'] == \TYPO3\CMS\Core\Utility\HttpUtility::SCHEME_HTTPS || $page['url_scheme'] == 0 && GeneralUtility::getIndpEnv('TYPO3_SSL')) {
                                $protocol = 'https';
                        }
-                       $domainName = self::firstDomainRecord($rootLine);
+                       $previewDomainConfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN.previewDomain', self::getPagesTSconfig($pageId));
+                       if ($previewDomainConfig['value']) {
+                               $domainName = $previewDomainConfig['value'];
+                       } else {
+                               $domainName = self::firstDomainRecord($rootLine);
+                       }
                        if ($domainName) {
                                $domain = $domainName;
                        } else {