[TYPO3-english] display random value from array in fluid template

Udo Leimberger udo at t3developer.de
Wed Jun 12 12:43:11 CEST 2013


Good morning,

i think the best is to write an own ViewHelper for this.

-easy and quick
- full control

regards Udo


IPhone Mail

Am 12.06.2013 um 06:39 schrieb Muriel le Pair <typo3 at strangefruit.nl>:

> Hi,
> 
> How do I display just one random value from an array in a fluid template?
> 
> I tried playing around with cycle but I don't know how to make them random:
> 
> settings {
> 
>  icons {
>      10 = icon1
>      20 = icon2
>    }
> }
> 
> <f:for each="{settings.icons}" as="img" iteration="iterator">
>   <f:if condition="{iterator.cycle} < 1">
>      {img}
>   </f:if>
> </f:for>
> 
> --
> kind regards,
> 
> Muriel le Pair
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


More information about the TYPO3-english mailing list