Typo3 新闻扩展:"TypoScript object path "lib.tx_news.contentElementRendering“不存在”

Typo3 News Extension: "TypoScript object path "lib.tx_news.contentElementRendering" does not exist"

如果不故意更改配置或模板中的某些内容,我无法在新闻文章的详细视图中输出内容元素。

1/1) #1253191023 TYPO3Fluid\Fluid\Core\ViewHelper\Exception

TypoScript object path "lib.tx_news.contentElementRendering" does not exist

我有这样的配置:

typo3conf/ext/news/Configuration/TypoScript/setup.txt

# Rendering of content elements in detail view
lib.tx_news.contentElementRendering = RECORDS
lib.tx_news.contentElementRendering {
    tables = tt_content
    source.current = 1
    dontCheckPid = 1
}

typo3conf/ext/site_package/Resources/Plugin/News/Templates/News/Detail.html

<f:if condition="{newsItem.contentElements}">
 <!-- content elements -->
 <f:cObject typoscriptObjectPath="lib.tx_news.contentElementRendering">
  {newsItem.contentElementIdList}
 </f:cObject>
</f:if>

所以在我看来,这是文档中推荐的内容:https://docs.typo3.org/p/georgringer/news/master/en-us/Tutorials/Templates/RenderContentElements/Index.html

Typo3 版本:10.4.12

新闻版本:8.5.2

我不明白为什么我突然无法在新闻文章中输出内容元素。

有人能帮忙吗?

如果 lib.tx_news.contentElementRendering 未定义,很可能您忘记包含 EXT:news 的静态 TypoScript 模板。

News system - Installation:

Preparation: Include static TypoScript

The extension ships some TypoScript code which needs to be included.

  1. Switch to the root page of your site.
  2. Switch to the Template module and select Info/Modify.
  3. Press the link Edit the whole template record and switch to the tab Includes.
  4. Select News (news) at the field Include static (from extensions):