我的新闻配置存在问题
TYPO3:7.6.11
realurl:2.1.4
新闻:5.2.0
我创建了以下realurl_conf.php。 (http://pastebin.com/GsYVaaDr):
<?php
// realurl naming precedence configuration
$TYPO3_CONF_VARS['FE']['addRootLineFields'] .= 'tx_realurl_pathsegment,alias,title';
$TYPO3_CONF_VARS['EXTCONF']['realurl']['p372493.mittwaldserver.info'] = array(
'init' => array(
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/',
// Allow for proper SEO 404 handling
'postVarSet_failureMode' => ''
),
'redirects' => array(),
'preVars' => array(
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'L',
'valueMap' => array(
// Sprachvariable Deutsch
'de' => '0',
),
'noMatch' => 'bypass',
),
),
// PAGEPATH mit Standard-Realurl-Konfiguration
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'rootpage_id' => 1,
'expireDays' => 30,
// Nimmt Sysordner aus der Rootline (aktuell auskommentiert!)
'excludeDoktypes' => '254',
'segTitleFieldList' => 'tx_realurl_pathsegment,alias,title'
),
'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'
),
'dateFilter' => array(
array(
'GETvar' => 'tx_newss_pi1[year]',
),
array(
'GETvar' => 'tx_newss_pi1[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',
),
),
array(
'GETvar' => 'tx_newss_pi1[day]',
),
),
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,
),
),
),
),
'postVarSets' => array(
'_DEFAULT' => array(
// NEWS
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
),
),
),
'newsTagConfiguration' => 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' => '-'
),
),
),
),
'28' => 'newsDetailConfiguration',
# '701' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
# '71' => 'newsTagConfiguration',
# '72' => 'newsCategoryConfiguration',
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
),
),
// 'archiv' => array(
// 'GETvar' => '',
// noMatch => 'bypass'
// ),
// NEWS
),
),
'fileName' => array (
'defaultToHTMLsuffixOnPrev' => true,
'index' => array(
'sitemap.xml' => array(
'keyValues' => array(
'type' => 841132,
),
),
'feed.rss' => array(
'keyValues' => array(
type => 9818,
),
),
'calender.ical' => array (
'keyValue' => array(
type => 9819,
),
),
'robots.txt' => array(
'keyValues' => array(
'type' => 841133
),
),
'drucken.html' => array(
'keyValues' => array(
'type' => '98',
'print' => '1'
),
),
'index.html' => array(
'keyValues' => array(
'type' => '0',
),
),
),
'defaultToHTMLsuffixOnPrev' => true,
'acceptHTMLsuffix' => true,
),
);
?>
我按如下方式配置了新闻插件。
plugin.tx_news {
settings {
backPid = 25
listPid = 25
detail {
showPrevNext = 1
showSocialShareButtons = 0
}
list {
media {
image >
image {
maxWidth = 75
maxHeight = 75
}
}
}
link {
skipControllerAndAction = 1
hrDate = 1
hrDate {
day = d
month = m
year = Y
}
}
paginate {
itemsPerPage = 10
insertAbove = 1
insertBelow = 1
templatePath =
prevNextHeaderTags = 1
maximumNumberOfLinks = 3
}
analytics.social {
facebookLike = 0
facebookShare = 0
twitter = 0
}
}
predefine.archive = +1 Month
}
此配置以下列形式发出地址:
/nachricht/detail/News/news-title/archiv/2016/september.html?tx_news_pi1%5Bday%5D=2&cHash=bc08b3c694b77edd4d3de72396906807
但是我需要这样的地址输出:
/nachricht/detail/News/2016/09/02/news-title.html
nachricht是该页面的标题。 realurl的基本配置正常运行。
有人有想法或者可以告诉我,如何更新配置的新闻部分?
答案 0 :(得分:3)
首先,更改&#39; enableCHashCache&#39; =&GT;真实的&#39; enableCHashCache&#39; =&GT;在您的realurl_conf.php中为您的网址删除cHash = ....并在postVatSets数组中更改以下代码以供实现。试试这个解决方案,让我知道您的反馈。这段代码适合我。
'postVarSets' => array(
'_DEFAULT' => array(
//archive
'period' => array (
array (
'condPrevValue' => -1,
'GETvar' => 'tx_ttnews[pS]',
//'valueMap => array()
),
array (
'GETvar' => 'tx_ttnews[pL]',
//'valueMap => array()
),
array (
'GETvar' => 'tx_ttnews[arc]',
'valueMap' => array(
'non-archived' => -1,
),
),
),
'archive' => array(
array(
'GETvar' => 'tx_ttnews[year]' ,
),
array(
'GETvar' => 'tx_ttnews[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',
)
),
),
'browse' => array (
array (
'GETvar' => 'tx_ttnews[pointer]',
),
),
'select' => array (
array (
'GETvar' => 'tx_ttnews[cat]',
'lookUpTable' => array (
'table' => 'tt_news_cat',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause'=> 'AND NOT deleted',
'useUniqueCache'=> 1,
'useUniqueCache_conf' => array (
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
'article' => array(
array (
'GETvar' => 'tx_ttnews[tt_news]',
'lookUpTable' => array (
'table' => 'tt_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause'=> 'AND NOT deleted',
'useUniqueCache'=> 1,
'useUniqueCache_conf' => array (
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
),
),