我如何通过Typoscript正确实例化tx_news

时间:2019-01-24 23:02:44

标签: typo3 typoscript typo3-8.x tx-news

我需要通过Typoscript创建一个tx_news实例,但是当我设置起点或极限设置时,该插件不会显示在前端;如果没有这些选项,它将分散所有存储新闻。

我已关注https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/BestPractice/IntegrationWithTypoScript/Index.html#add-news-by-typoscript和其他页面中的文档。我正在使用TYPO3 8.7和PHP 7.1

#Remove content in section
page.10.variables.noticiasGNFA > 
lib.news = USER
lib.news {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = News
    pluginName = Pi1
    vendorName = GeorgRinger

    switchableControllerActions {
        News {
            1 = list
            }
    }

    settings < plugin.tx_news.settings
    settings {
        detailPid = 515
        overrideFlexformSettingsIfEmpty := addToList(detailPid)

        orderBy = datetime
        listPid = 151
        backPid = 151                       
        disableOverrideDemand = true
        templateLayout = 4
        #startingpoint = 318
        #limit =3
    }
}
#Set new tx_news plugin in section 
page.10.variables.noticiasGNFA < lib.news

删除带有井号的任何选项的注释时,它将不起作用。不显示,不显示异常。

1 个答案:

答案 0 :(得分:0)

如果您使用的是Fluid模板,则可以在任何地方使用<f:cObject typoscriptObjectPath="lib.news"/>

希望有帮助。