[TYPO3-mvc] How to use If-ViewHelper with other than true/false

Steffen Kamper info at sk-typo3.de
Sun Jun 7 21:57:40 CEST 2009


Hi,

Joerg Schoppet schrieb:
> Hi,
> 
> I managed it to get the If-ViewHelper to work for simple stuff like 
> array-check or true/false values.
> 
> Now I have a radio-button value, which can have the values 0, 1, 2.
> 
> How to use this in the If-ViewHelper?
> 
> <f:if condition="{product.abc} == 1"> or
> <f:if condition="{product.abc} == 2">
> 
> always validates to true, regardless if product.abc is 1 or 2.
> 
> 
> How is the syntax?
> 
> 

when you look to source you'll find this:

  * <f:if condition="somecondition">
  *   This is being shown in case the condition matches
  * </f:if>

so syntax should be
<f:if condition="{product.abc == 1}">

vg Steffen


More information about the TYPO3-project-typo3v4mvc mailing list