Skip to content

Instantly share code, notes, and snippets.

@lorenzulrich
Last active August 12, 2017 07:39
Show Gist options
  • Save lorenzulrich/19407e8cfbf6a1af21ab to your computer and use it in GitHub Desktop.
Save lorenzulrich/19407e8cfbf6a1af21ab to your computer and use it in GitHub Desktop.
TYPO3: One domain per language with RealURL
[globalVar = GP:L=1]
config {
sys_language_uid = 1
language = en
locale_all = en_CH.utf8
htmlTag_langKey = en
baseURL = http://default.domain.tld/
}
[global]
lib.menu.language = HMENU
lib.menu.language {
special = language
special.value = 0,1
1 = TMENU
1 {
NO = 1
NO {
# Override the standard menu item value (which is the page title) with our own cObject
stdWrap.cObject = TEXT
# Use the TypoScript option split function to display different values for the first and second item
stdWrap.cObject.value = DE || EN
}
ACT < .NO
ACT {
ATagParams = class="active"
}
USERDEF1 = 1
USERDEF1.doNotShowLink = 1
USERDEF2 < .USERDEF1
}
}
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
'default.domain.tld' => array(
'init' => array(
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/'
),
'pagePath' => array(
'type' => 'user',
//'disablePathCache' => true,
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'rootpage_id' => '2'
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 0
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => 0,
'en' => 1
),
'valueDefault' => 'de',
'noMatch' => 'bypass'
)
),
'postVarSets' => array(
'_DEFAULT' => array(
)
)
),
'_DOMAINS' => array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => '0',
'useConfiguration' => 'default.domain.tld',
'urlPrepend' => 'http://default.domain.tld',
'ifDifferentToCurrent' => 'true'
),
array(
'GETvar' => 'L',
'value' => '1',
'useConfiguration' => 'secondary.domain.tld',
'urlPrepend' => 'http://secondary.domain.tld',
'ifDifferentToCurrent' => 'true'
)
),
'decode' => array(
'default.domain.tld' => array(
'GETvars' => array(
'L' => ''
),
'useConfiguration' => 'default.domain.tld'
),
'secondary.domain.tld' => array(
'GETvars' => array(
'L' => '1'
),
'useConfiguration' => 'secondary.domain.tld'
)
)
)
);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['secondary.domain.tld'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['default.domain.tld'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment