[TYPO3-mvc] Nested if-ViewHelper results in blank page

Johannes Klug mail at johannesklug.de
Wed Jun 20 09:18:24 CEST 2012


Hey,

I stumbled upon this weird behavior, maybe I'm doing something wrong,
possibly this is a bug (or a missing feature) in fluid.

I have a template with nested viewhelpers

<f:if condition="{anyCondition}">
 <f:for each="{field.fieldData}" as="entry" key="index" >
  <f:if condition="{field.isArrayType}">
   <f:then>
    <input type="hidden" value="{entry}"
name="form[{field.name}][{index}]" />
   </f:then>
   <f:else>
    <input type="hidden" value="{entry}" name="form[{field.name}]" />
   </f:else>
  </f:if>
  <li>{field.name}: {entry}</li>
 </f:for>
</f:if>

This results in the page not being rendered at all (blank page), so I'm
assuming some runtime error in IfViewHelper.php. If I leave out the
outer <f:if >-Tags the template is rendered just fine, but I obviously
don't want that.

If I write
<f:if condition="{anyCondition}">
Hello World!
</f:if>
 <f:for each="{field.fieldData}" as="entry" key="index" >
  <f:if condition="{field.isArrayType}">
   <f:then>
    <input type="hidden" value="{entry}"
name="form[{field.name}][{index}]" />
   </f:then>
   <f:else>
    <input type="hidden" value="{entry}" name="form[{field.name}]" />
   </f:else>
  </f:if>
  <li>{field.name}: {entry}</li>
 </f:for>

I get "Hello World! + laterContent" just fine, too. Is there some issue
with nested ifs in Fluid?

Versions: Typo3 4.6.9 / Fluid 1.4.1 / Extbase 1.4.4

Cheers,
J


More information about the TYPO3-project-typo3v4mvc mailing list