[英]TYPO3 - tx_news - Show related articles on detail page except current article
On the detail page of a tx_news record I also provide 'related articles' of the current article/record ... with the below snippet. 在tx_news记录的详细信息页面上,我还提供带有以下代码段的当前文章/记录的“相关文章”。 But in the suggested 'related articles' the current record is also provided. 但是在建议的“相关文章”中也提供了当前记录。 How can I exclude the current article from the suggested list? 如何从建议列表中排除当前文章?
Typoscript: 打字稿:
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
}
}
News Detail.html 新闻Detail.html
<!-- related articles -->
<f:if condition="{newsItem.firstCategory}">
<f:cObject typoscriptObjectPath="lib.relatedByFirstCategory.articles">{newsItem.firstCategory.uid}</f:cObject>
</f:if>
</f:if>
Source: https://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#show-news-items-with-same-category-in-detail-html 来源: https : //docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#show-news-items-with-same-category-in-detail-html
excludeAlreadyDisplayedNews
is your friend. excludeAlreadyDisplayedNews
是您的朋友。 Look here: https://docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#excludealreadydisplayednews 在这里查看: https : //docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#excludealreadydisplayednews
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.