【问题标题】:TYPO3 9 LTS - Site configuration in multidomain environmentTYPO3 9 LTS - 多域环境中的站点配置
【发布时间】:2019-04-02 20:33:22
【问题描述】:

拥有多域环境,我不想再次为每个域定义相同的配置(尤其是扩展记录的路由增强器)(每个域都拥有例如新闻详细信息页面)。是否有类似全局或可重用预配置的可能性?

使用 realUrl 可以实现以下目标:

    'fixedPostVars' => array(
    'newsDetail' => array(
        array(
            'GETvar' => 'tx_myext_news[news]',
            'lookUpTable' => array(
                'table' => 'tx_myext_domain_model_news',
                'id_field' => 'uid',
                'alias_field' => 'title',
                'enable404forInvalidAlias' => 1,
                'addWhereClause' => ' AND NOT deleted',
                'useUniqueCache' => 1,
                'useUniqueCache_conf' => array(
                    'strtolower' => 1,
                    'spaceCharacter' => '-'
                ),
                'languageGetVar' => 'L',
                'languageExceptionUids' => '',
                'languageField' => 'sys_language_uid',
                'transOrigPointerField' => 'l10n_parent'                        
            ),
        ),
    ),
    '129' => 'newsDetail',
    '130' => 'newsDetail',
    '53'  => 'newsDetail',
    '131' => 'newsDetail',
    '150' => 'newsDetail',
    '182' => 'newsDetail',
),

【问题讨论】:

    标签: url configuration routing typo3 typo3-9.x


    【解决方案1】:

    这是一个数组:DEMO 根据域插入值,希望这就是你的意思吗?

    switch($_SERVER['HTTP_HOST']) {
    case 'othersite.nl':
    case 'www.othersite.nl':
        $newsDetail = array(12,34,67,288);
    break;
    case 'website.nl':
    case 'www.website.nl':
        $newsDetail = array(15,534,56,258);
    break;
    }
    foreach($newsDetail as $value){
        $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['fixedPostVars'][$value] = 'newsDetailConfiguration';
    }
    

    此代码与配置数组一起从一个简单的数字数组中插入值。

    【讨论】:

    • 这只是针对 realurl 配置的另一种写法。 JKB 想知道如何在 TYPO3 9 中做到这一点,其中说话的 URL 是由核心生成的。
    • 是的,没错。我想要类似“嵌套”站点配置的东西。在顶层,我为扩展记录详细信息页面定义了路由增强器。在更深层次上,我为域定义了通常的站点配置...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多