簡體   English   中英

TYPO3-tx_news-在詳細信息頁面上顯示相關文章(當前文章除外)

[英]TYPO3 - tx_news - Show related articles on detail page except current article

在tx_news記錄的詳細信息頁面上,我還提供帶有以下代碼段的當前文章/記錄的“相關文章”。 但是在建議的“相關文章”中也提供了當前記錄。 如何從建議列表中排除當前文章?

打字稿:

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>

來源: https : //docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#show-news-items-with-same-category-in-detail-html

excludeAlreadyDisplayedNews是您的朋友。 在這里查看: https : //docs.typo3.org/typo3cms/extensions/news/stable/singlehtml/Index.html#excludealreadydisplayednews

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM