[TYPO3-english] Flux: conditions inside objects
bernd wilke
t3ng at bernd-wilke.net
Tue Feb 18 08:32:18 CET 2014
Am 17.02.14 13:58, schrieb Viktor Livakivskyi:
>
>> What I want to achieve:
>>
>> <flux:flexform.sheet name="products">
>> <flux:flexform.section name="products">
>> <flux:flexform.object name="product">
>> <flux:flexform.field.input name="headline" />
>> <flux:flexform.field.checkbox name="useImageByNr" default="1"
>> requestUpdate="1" transform="integer" />
>> <f:if condition="{???????.useImageByNr}">
>> <f:then><flux:flexform.field.input name="imagenumber"/></f:then>
>> <f:else><flux:flexform.field.file name="imagefile"
>> internalType="file" allowed="jpg,png" maxItems="1" showThumbs="1"
>> /></f:else>
>> </f:if>
>> </flux:flexform.object>
>> </flux:flexform.section>
>> </flux:flexform.sheet>
>>
>> what so I need to write for the ??????? ?
>>
>
> Hi, Bernd.
>
> According to this article [1], you can simply put <f:if
> condition="{useImageByNr}">
>
> You can try and write the result here, since we also didn't try such a
> thing.
a condition based on a value on top-level is possible. I've done it. [2]
now I want the condition based on a value of a (sub)-object. I first
tried without context assuming it would use the current context - but it
failed. it takes a value of top-level (see[2]).
so my question: what prefix to use?
[2]
this works, but has the condition based on a global value instead of a
value assigned to each object:
<flux:flexform.sheet name="products">
<flux:flexform.section name="products">
<flux:flexform.field.checkbox name="useImageByNr" default="1"
requestUpdate="1" transform="integer" />
<flux:flexform.object name="product">
<flux:flexform.field.input name="headline" />
<f:if condition="{useImageByNr}">
<f:then><flux:flexform.field.input name="imagenumber"/></f:then>
<f:else><flux:flexform.field.file name="imagefile"
internalType="file" allowed="jpg,png" maxItems="1" showThumbs="1"
/></f:else>
</f:if>
</flux:flexform.object>
</flux:flexform.section>
</flux:flexform.sheet>
> [1]: http://jkphl.is/articles/dating-fluid-powered-typo3
bernd
--
http://www.pi-phi.de/cheatsheet.html
More information about the TYPO3-english
mailing list