Search code examples
typo3typo3-extensionstx-newstypo3-10.x

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


Without knowingly having changed something in the configuration or templates, I can't output content elements in the detail view of news-articles.

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

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

I have this configuration:

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>

So it looks to me as it is what is recommended in the docs: https://docs.typo3.org/p/georgringer/news/master/en-us/Tutorials/Templates/RenderContentElements/Index.html

Typo3 version: 10.4.12

News version: 8.5.2

I can't figure out why I can't output content-elements in news-articles all of the sudden.

Can anyone help?


Solution

  • If lib.tx_news.contentElementRenderingis not defined, most likely you've forgotten to include the static TypoScript Template of EXT:news.

    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): Screenshot of TYPO3 backend's "Include static" field