user2310852
user2310852

Reputation: 1674

TYPO3 Multidomain Website Preview shows only Default Language

I'm using TYPO3 7.6 with a multidomain and multilanguage Website, you see the links below. I've one page tree and rootpage_id for all three languages!

  1. First language is german (L=0, https://www.renosan.de/)
  2. Second language is english (L=1, https://www.renosan.net/)
  3. Third language is polish (L=2, https://www.renosan.pl/)

For every language I'm using an own top-level domain (de,net,pl). I've also insert the domain records at my root page (TYPO3-Backend List -> Rootpage -> Domain records)

If I'm clicking at the preview button (s. image), the preview opens in a new window with: typo3 backend preview page

... but the content is still in the default language (german)! I need to change the TLD to change the Website language manually. It's not useful for my editors, because they aren't seeing the preview with one click.

Can someone explain the behaviour from TYPO3?

I also tried to login into Backend from .net or .pl, nothing happens. It's always the default preview. No special .htaccess entries ...

My TypoScript Setup

### 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]

I have locate the problem with my individual realURL-conf. If I try it with the 'autoconf' from Ext:realURLthe preview from Backend works!

Here's my personal realURL-Configuration file:

<?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'
        ),
    )
);
?>

Thanks for your help .. I have still no solution for this TYPO3-Problem?! Is it a TYPO3-Bug? Is there a problem with my realURL-Configuration-File?

Upvotes: 0

Views: 929

Answers (2)

Ren&#233; Pflamm
Ren&#233; Pflamm

Reputation: 3354

If you use RealURL: Look at this blog post. Here you can see how to config realURL to watch at the Domains to seperate languages.

After that, you dont need conditions about the domains. You can use the simple [globalVar = GP:L = x] conditions.

Upvotes: 0

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

I think your conditions are wrong and TYPO3 gets so confused that the conditions are ignored completely.

it is not

[global string = ENV: HTTP_HOST = ...

but:

[globalString = ENV:HTTP_HOST = ...

On the other hand I assume your TYPO3 will also gets confused about domains and additional language parameter. For preview you need to be logged in into the BE (cookies are domain dependend). So a preview in another language is possible only with language parameter. Your configuration mixes domains and language parameter: if you start with www.renosan.de?L=1 your baseurl is changed.
My recommandation: Split the handling depending on domain and L-Param.

Upvotes: 0

Related Questions