有了一个多域环境,我不想再为每个域定义相同的配置(特别是扩展记录的路由增强器)(每个域自己,例如一个新闻-详细页面)。是否存在全局或可重用的预配置可能性?
使用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',
),发布于 2018-10-30 05:57:47
这是一个数组: 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';
}与配置数组一起,这段代码插入一个简单的数字数组中的值。
https://stackoverflow.com/questions/53053489
复制相似问题