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

BENCH Artwork lists at bench-artwork.ch
Fri Nov 22 13:07:28 CET 2013


Hi Frans,

this didn't work. But i got it with nonMediaPreviews:
<f:alias map="{mediaElement: newsItem.nonMediaPreviews.0}">

Thank you!


Am 22.11.2013 um 12:51 schrieb Frans Saris <franssaris at gmail.com>:

> Try
> 
> <f:alias map="{mediaElement: newsItem.media.0}">
> 
> Gr. Frans
> Op 22 nov. 2013 12:42 schreef "BENCH Artwork" <lists at bench-artwork.ch>:
> 
>> 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?
>> _______________________________________________
>> TYPO3-project-tt-news mailing list
>> TYPO3-project-tt-news at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-tt-news
>> 
> _______________________________________________
> TYPO3-project-tt-news mailing list
> TYPO3-project-tt-news at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-tt-news



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