0
votes

I would like to access to the Data (Specially the Media data) of the current visible news item outside of the news template. For example in the page template itself.

I hoped to find a ViewHelper in the news extension but there is no.

Currently I only see a way to do it like this somehow:

https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/BestPractice/IntegrationWithTypoScript/Index.html#plain-typoscript

Read the data via TypoScript and put it in a lib variable and then read it in the fluid template.

Did someone have an alternative, easier way?

2

2 Answers

0
votes

I think that For this you are need use TypoScript together with ViewHelper

For example:

lib.tx_news.detail {
   ....something 
}

<f:cObject typoscriptObjectPath="lib.tx_news.detail"/>
0
votes

It sounds like you want a very special view to your news record. That could be done with a second news plugin as a detail view on your page. As you do not want the text from the default detail view you can build a special layout so you only get the media data.
A plugin can be inserted as a content element in a special column or by typoscript.

Another way would be to do the queries on your own:
Either in typoscript (as a CONTENT object) or in PHP (as a viewhelper):
Identify the currently shown news by the URL parameter, then select all media related to that record.