[TYPO3-ttnews] tx_news - display first image if showinpreview is not set

BENCH Artwork lists at bench-artwork.ch
Fri Nov 22 12:42:17 CET 2013


Hi,

I'm searching for a solution to display the first image in list view if showinpreview is not set. 
Something like this won't work:

<f:if condition="{newsItem.mediaPreviews}">
	<f:then>
		<f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
			<f:image src="uploads/tx_news/{mediaElement.image}" title="{mediaElement.title}" alt="{newsItem.title}" width="300c" height="168c" />
		</f:alias>
	</f:then>
	<f:else>
		<f:alias map="{mediaElement: newsItem.media}">
			<f:image src="uploads/tx_news/{mediaElement.image}" title="{mediaElement.title}" alt="{newsItem.title}" width="300c" height="168c" />
		</f:alias>
	</f:else>	
</f:if>

Any help?


More information about the TYPO3-project-tt-news mailing list