TYPO3 - tx_news - 在详细信息页面上显示除当前文章之外的相关文章
TYPO3 - tx_news - Show related articles on detail page except current article
在 tx_news 记录的详细信息页面上,我还提供了当前 article/record 的 'related articles' ... 下面的代码片段。但是在提示'related articles'中也提供了当前记录。如何从建议列表中排除当前文章?
错别字:
lib.relatedByFirstCategory.articles = USER
lib.relatedByFirstCategory.articles {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = News
pluginName = Pi1
vendorName = GeorgRinger
switchableControllerActions {
News {
1 = list
}
}
settings < plugin.tx_news.settings
settings {
#relatedView = 1
detailPid = 97
useStdWrap := addToList(categories)
categories.current = 1
categoryConjunction = or
overrideFlexformSettingsIfEmpty := addToList(detailPid)
startingpoint = 96
templateLayout = 4
hidePagination = 1
# added
excludeAlreadyDisplayedNews =1
}
}
新闻Detail.html
<!-- related articles -->
<f:if condition="{newsItem.firstCategory}">
<f:cObject typoscriptObjectPath="lib.relatedByFirstCategory.articles">{newsItem.firstCategory.uid}</f:cObject>
</f:if>
</f:if>
excludeAlreadyDisplayedNews
是你的朋友。看这里:https://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#excludealreadydisplayednews
在 tx_news 记录的详细信息页面上,我还提供了当前 article/record 的 'related articles' ... 下面的代码片段。但是在提示'related articles'中也提供了当前记录。如何从建议列表中排除当前文章?
错别字:
lib.relatedByFirstCategory.articles = USER
lib.relatedByFirstCategory.articles {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = News
pluginName = Pi1
vendorName = GeorgRinger
switchableControllerActions {
News {
1 = list
}
}
settings < plugin.tx_news.settings
settings {
#relatedView = 1
detailPid = 97
useStdWrap := addToList(categories)
categories.current = 1
categoryConjunction = or
overrideFlexformSettingsIfEmpty := addToList(detailPid)
startingpoint = 96
templateLayout = 4
hidePagination = 1
# added
excludeAlreadyDisplayedNews =1
}
}
新闻Detail.html
<!-- related articles -->
<f:if condition="{newsItem.firstCategory}">
<f:cObject typoscriptObjectPath="lib.relatedByFirstCategory.articles">{newsItem.firstCategory.uid}</f:cObject>
</f:if>
</f:if>
excludeAlreadyDisplayedNews
是你的朋友。看这里:https://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#excludealreadydisplayednews