简体   繁体   English

TYPO3 RealUrl:从URL段中选择页面树和语言

[英]TYPO3 RealUrl: select pagetree and language from url segment

We have multiple pagetrees for each region (eg Germany, Suisse). 每个区域(例如德国,瑞士)都有多个页面树。 The pages themselves are translated to several languages (eg de, en) using the L-Parameter. 使用L参数将页面本身翻译成多种语言(例如,de,en)。

Now Realurl should match from 2 url segments to the approriate page tree and language. 现在,Realurl应该从2个url段匹配到适当的页面树和语言。 I know how this can be done with separate domains for each region using the _Domains feature. 我知道如何使用_Domains功能为每个区域使用单独的域来完成。 But in this case the domain stays always the same for all regions. 但是在这种情况下,所有区域的域始终保持不变。 Can this be achieved with Realurl and how? 使用Realurl可以实现吗?如何实现?

http://example.com/de/de => should map to pagetree with rootpage_id 1 and language de (L=0) http://example.com/de/de =>应该映射到具有rootpage_id 1和语言de(L = 0)的pagetree

http://example.com/de/en => should map to pagetree with rootpage_id 1 and language en (L=1) http://example.com/de/en =>应该映射到rootpage_id为1且语言为en(L = 1)的pagetree

http://example.com/ch/de => should map to pagetree with rootpage_id 2 and language de (L=0) http://example.com/ch/de =>应该映射到具有rootpage_id 2和语言de(L = 0)的pagetree

http://example.com/ch/en => should map to pagetree with rootpage_id 2 and language en (L=1) http://example.com/ch/zh-CN =>应该以rootpage_id 2和语言en(L = 1)映射到pagetree

real_url.conf real_url.conf

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
    'init' => array(
        'enableCHashCache' => 1,
        'appendMissingSlash' => 'ifNotFile,redirect',
        'adminJumpToBackend' => 1,
        'enableUrlDecodeCache' => 1,
        'enableUrlEncodeCache' => 1,
        'emptyUrlReturnValue' => '/'
    ),
    '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
    ),
    'preVars' => array(
        array(
            'GETvar' => 'L',
            'valueMap' => array(
                'de' => '0',
                'en' => '1',
            ),
            'valueDefault' => 'de',
        ),
       array(
            'GETvar' => 'no_cache',
            'valueMap' => array(
                'no_cache' => 1,
            ),
            'noMatch' => 'bypass',
        ),
    ),
);

Now Realurl should match from 2 url segments to the approriate page tree and language. 现在,Realurl应该从2个url段匹配到适当的页面树和语言。

RealURL cannot do that. RealURL无法做到这一点。 Root page id is determined before segments are processed. 根页ID是在处理段之前确定的。 It is defined by the domain record or your RealURL configuration. 它由域记录或您的RealURL配置定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM