[TYPO3-german] Eigener Workaround, aber trotzdem Lösung erwünscht
Johannes Dörr
groups at johannesdoerr.de
Wed Jun 10 17:36:18 CEST 2009
Ich habs jetzt selbst programmiert, funktioniert wie folgt
(Konfiguration von RealURL):
<?php
function getRootPageIDs($a) {
return $a['pagePath']['rootpage_id'];
}
function user_encodeSpURL(&$params, &$ref) {
$domains = array_filter(array_map('getRootPageIDs',
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']));
unset($domains['_DEFAULT']);
$domains = array_flip($domains);
foreach
($GLOBALS['TSFE']->sys_page->getRootline($params['params']['args']['page']['uid'])
as $index => $value) {
if (isset($domains[$value['uid']])) {
$params['URL'] =
'http://'.$domains[$value['uid']].'/'.$params['URL'];
break;
}
}
}
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
# Hook setzten
'encodeSpURL_postProc' => array('user_encodeSpURL'),
'_DEFAULT' => array (
'init' => array (
'enableCHashCache' => '1',
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => '1',
'enableUrlEncodeCache' => '1',
),
'redirects' => array (
),
'preVars' => array (
'0' => array (
'GETvar' => 'no_cache',
'valueMap' => array (
'nc' => '1',
),
'noMatch' => 'bypass'
),
'1' => array (
'GETvar' => 'L',
'valueMap' => array (
'de' => '0',
'en' => '1',
),
'noMatch' => 'bypass',
),
'2' => array (
'GETvar' => 'lang',
'valueMap' => array (
'de' => 'de',
'en' => 'en',
),
'noMatch' => 'bypass',
),
),
'pagePath' => array (
'type' => 'user',
'userFunc' =>
'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '7',
'rootpage_id' => '1',
),
'fixedPostVars' => array (
),
'postVarSets' => array (
# ...
),
'fileName' => array (
# ...
),
),
);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain1.de']=$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain1.de']['pagePath']['rootpage_id']
= '1';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain2.de']=$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.domain2.de']['pagePath']['rootpage_id']
= '5';
?>
Auf den Root-Seiten muss das Flag "is root of site" ausgewählt sein.
Trotzdem würde ich mir diese Konstruktion gerne sparen, nur weiß ich
leider nicht, wo es bei meiner Konfiguration hakt.
Viele Grüße,
Johannes
More information about the TYPO3-german
mailing list