I try to change the layout which wraps each content-element by the definition from the backend. Unfortunately it seems that the variable for {data} is ONLY available inside of the <f:section> element. Even more problematic, the <f:if> condition ViewHelper has NO effect outsite of <f:section>, both <f:layout> statements are executed and only the last one is applied for rendering. That's not useful... and the documentation does talk only about ViewHelper inside of the Section. Do you know any other way to achieve this? Thanks in advance!
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:if condition="{data.layout} == 101"><!-- if-condition has no effect here -->
<f:then>
<f:layout name="FullWidth" />
</f:then>
<f:else>
<f:layout name="Default" />
</f:else>
</f:if>
<f:debug>TEST1: {data.layout}</f:debug><!-- THIS DOES NOT SHOW UP AT ALL! -->
<f:section name="Main">
<f:debug>TEST2: {data.layout}</f:debug><!-- Output is TEST2: 101 (integer) -->
[...]
</f:section>
</html>