TYPO3多域网站预览仅显示默认语言

时间:2017-07-10 16:35:28

标签: typo3 preview multilingual multiple-domains realurl

我正在使用TYPO3 7.6多域和多语言网站,您会看到以下链接。我有一个页面树,所有三种语言都有rootpage_id

  1. 第一语言是德语(L = 0,https://www.renosan.de/
  2. 第二语言是英语(L = 1,https://www.renosan.net/
  3. 第三语言是波兰语(L = 2,https://www.renosan.pl/
  4. 对于我使用自己的顶级域名(de,net,pl)的每种语言。我还在我的根页面插入域记录(TYPO3-后端列表 - >根页 - >域记录)

    如果我点击预览按钮(s。图像),预览将在新窗口中打开,其中包含:typo3 backend preview page

    ...但内容仍然是默认语言(德语)!我需要更改TLD以手动更改网站语言。它对我的编辑没用,因为他们只需点击一下就看不到预览。

    有人可以解释TYPO3的行为吗?

    我还尝试从.net.pl登录后端,没有任何反应。它始终是默认预览。没有特殊的.htaccess条目...

    我的TypoScript设置

    ### default german
    config {
      linkVars = L(0-2)
      uniqueLinkVars = 1
    
      sys_language_mode = content_fallback
      sys_language_overlay = hideNonTranslated
      sys_language_uid = 0
    
      language = de
      locale_all = de_DE.UTF8
      htmlTag_langKey = de
    }
    
    
    ### english L=1
    [globalString = IENV:HTTP_HOST = *renosan.net]
    config {
        baseURL = https://www.renosan.net/
        sys_language_uid = 1
        language = en
        locale_all = en_GB.UTF8
        htmlTag_langKey = en
    }
    [GLOBAL]
    
    
    ### polski L=2
    [globalString = IENV:HTTP_HOST = *renosan.pl]
    config {
        baseURL = https://www.renosan.pl/
        sys_language_uid = 2
        language = pl
        locale_all = pl_PL.UTF8
        htmlTag_langKey = pl
    }
    [GLOBAL]
    

    我找到了个人realURL-conf的问题。如果我使用来自Ext:realURL的'autoconf'进行尝试,后端的预览就可以了!

    这是我的个人realURL配置文件:

    <?php
    $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
        'pagePath' => array(
            'type' => 'user',
            'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'expireDays' => '3',
            'rootpage_id' => 1,
            'firstHitPathCache'=> 1
        ),
        'init' => array(
            'enableCHashCache' => 1,
            'respectSimulateStaticURLs' => 0,
            'postVarSet_failureMode' => '',
            'enableUrlDecodeCache' => 1,
            'enableUrlEncodeCache' => 1
        ),
        'preVars' => array(
            array(
                'GETvar' => 'L',
                'valueMap' => array(
                    //'de' => '0',
                    'en' => '1',
                    'pl' => '2'
                ),
                'noMatch' => 'bypass',
            ),
            array(
                'GETvar' => 'no_cache',
                'valueMap' => array(
                    'nc' => 1,
                ),
                'noMatch' => 'bypass',
            ),
        ),
    
        'fixedPostVars' => array(
            'newsDetailConfiguration' => array(
                array(
                    'GETvar' => 'tx_news_pi1[action]',
                    'valueMap' => array(
                        'detail' => '',
                    ),
                    'noMatch' => 'bypass',
                ),
                array(
                    'GETvar' => 'tx_news_pi1[controller]',
                    'valueMap' => array(
                        'News' => '',
                    ),
                    'noMatch' => 'bypass',
                ),
    
                array(
                    'GETvar' => 'tx_news_pi1[news]',
                    'lookUpTable' => array(
                        'table' => 'tx_news_domain_model_news',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND NOT deleted',
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array(
                            'strtolower' => 1,
                            'spaceCharacter' => '-',
                        ),
                        'languageGetVar' => 'L',
                        'languageExceptionUids' => '',
                        'languageField' => 'sys_language_uid',
                        'transOrigPointerField' => 'l10n_parent',
                        'autoUpdate' => 1,
                        'expireDays' => 180,
                    ),
                ),
            ),
    
            '42' => 'newsDetailConfiguration',
            '43' => 'newsDetailConfiguration',
        ),
        'postVarSets' => array(
            '_DEFAULT' => array(
                'controller' => array(
                    array(
                        'GETvar' => 'tx_news_pi1[action]',
                        'noMatch' => 'bypass',
                    ),
                    array(
                        'GETvar' => 'tx_news_pi1[controller]',
                        'noMatch' => 'bypass',
                    ),
                ),
                'tags' => array(
                    array(
                        'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                        'lookUpTable' => array (
                            'table' => 'tx_news_domain_model_tag',
                            'id_field' => 'uid',
                            'alias_field' => 'title',
                            'addWhereClause' => 'AND NOT deleted',
                            'useUniqueCache' => 1,
                            'useUniqueCache_conf' => array (
                                'strtolower' => 1,
                                'spaceCharacter' => '-',
                            ),
                        ),
                    ),
                ),
    
                'seite' => array(
                    array(
                        'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
                    ),
                ),
    
                // news archive parameters
                'archiv' => array(
                    array(
                        'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
                    ),
                    array(
                        'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
                        'valueMap' => array(
                            'january' => '01',
                            'february' => '02',
                            'march' => '03',
                            'april' => '04',
                            'may' => '05',
                            'june' => '06',
                            'july' => '07',
                            'august' => '08',
                            'september' => '09',
                            'october' => '10',
                            'november' => '11',
                            'december' => '12',
                        ),
                    ),
                ),
    
            ),
        ),
    );
    
    
    
    $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DOMAINS'] = array(
        'encode' => array(
            array(
                'GETvar' => 'L',
                'value' => '0',
                'useConfiguration' => 'renosan.de',
                'urlPrepend' => 'https://www.renosan.de'
            ),
            array(
                'GETvar' => 'L',
                'value' => '1',
                'useConfiguration' => 'renosan.de',
                'urlPrepend' => 'https://www.renosan.net'
            ),
            [
                'GETvar' => 'L',
                'value' => '2',
                'useConfiguration' => 'renosan.de',
                'urlPrepend' => 'https://www.renosan.pl'
            ],
    
        ),
        'decode' => array(
            'renosan.de' => array(
                'GETvars' => array(
                    'L' => '0',
                ),
                'useConfiguration' => 'renosan.de'
            ),
            'renosan.net' => array(
                'GETvars' => array(
                    'L' => '1',
                ),
                'useConfiguration' => 'renosan.de'
            ),
            'renosan.pl' => array(
                'GETvars' => array(
                    'L' => '2',
                ),
                'useConfiguration' => 'renosan.de'
            ),
        )
    );
    ?>
    

    感谢您的帮助.. 我仍然没有针对此TYPO3问题的解决方案?!它是TYPO3-Bug吗?我的realURL配置文件有问题吗?

2 个答案:

答案 0 :(得分:0)

我认为你的条件是错误的,而且TYPO3非常混乱,完全忽略了条件。

它不是

[global string = ENV: HTTP_HOST = ...

但:

[globalString = ENV:HTTP_HOST = ...

另一方面,我假设您的TYPO3也会对域和其他语言参数感到困惑。对于预览,您需要登录BE(cookie是域依赖)。因此,只有语言参数才能使用其他语言进行预览。您的配置混合了域名和语言参数:如果您从www.renosan.de?L=1开始,您的baseurl就会更改 我的建议:根据域和L-Param拆分处理。

答案 1 :(得分:0)

如果您使用RealURL:请查看this blog post。在这里,您可以看到如何配置realURL以在域中观看以分离语言。

之后,您不需要有关域名的条件。您可以使用简单的[globalVar = GP:L = x]条件。