[TYPO3-dev] direct injection (tx_news): how to display media files?

Stefan Franke stefan.franke at gmx.co.uk
Tue Feb 4 11:41:39 CET 2014


Hello,
I have got an extension (TYPO3 6.2) that integrates the repository of "tx_news" via direct injection and I'm struggling to display the images that are connected to the news records.

The direct injection part works like a charm:

===start========================================================================
/**
 * news
 *
 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\News\Domain\Model\News>
 */
protected $news;
===stop=========================================================================


In the Fluid-Template I get all the necessary data for my HTML-output (at least via <f:debug>):

===start========================================================================
TYPO3\CMS\Extbase\Persistence\Generic\QueryResult (2 items)
	0 => Tx_News_Domain_Model_NewsDefault (uid=7, pid=36)
		[...]
		title => 'Heft zwei|2013' (14 chars)
		[...]
		media => TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage (1 items)
			00000000194911e9000000005a681961 => Tx_News_Domain_Model_Media (uid=2, pid=36)
				[...]
				image => 'myImage.jpg' (11 chars)
				[...]
===stop=========================================================================

All that is missing right now is that I cannot figure out how to display the media files of the news record.

Any ideas?

Thanks for your help,
Stefan



More information about the TYPO3-dev mailing list