微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Typo3 新闻扩展:“TypoScript 对象路径“lib.tx_news.contentElementRendering”不存在”

如何解决Typo3 新闻扩展:“TypoScript 对象路径“lib.tx_news.contentElementRendering”不存在”

在不知情的情况下更改配置或模板中的某些内容,我无法在新闻文章的详细信息视图中输出内容元素。

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

准备:包含静态 TypoScript

该扩展附带了一些需要包含的 TypoScript 代码。

  1. 切换到您网站的根页面。
  2. 切换到模板模块并选择信息/修改。
  3. 点击“编辑整个模板记录”链接并切换到“包括”选项卡。
  4. 在包含静态(来自扩展)字段中选择新闻(新闻): Screenshot of TYPO3 backend's "Include static" field

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。