具有多域环境,我不想为每个域再次定义相同的配置(尤其是扩展记录的路由增强器)(每个域都拥有例如新闻详细信息页面)。是否有全局或可重用的预配置可能性?
使用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',
),
答案 0 :(得分:0)
这是一个数组: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';
}
此代码与config数组一起从简单的数字数组中插入值。