简体   繁体   中英

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. 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

<!-- 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM