Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Else ViewHelper <f:else>
Else-Branch of a condition. Only has an effect inside of f:if
.
See the f:if
ViewHelper for documentation.
Examples
Output content if condition is not met
<f:if condition="{someCondition}">
<f:else>
condition was not true
</f:else>
</f:if>
Copied!
Output:
Everything inside the "else" tag is displayed if the condition evaluates to FALSE.
Otherwise nothing is outputted in this example.
Copied!
Source code
Go to the source code of this ViewHelper: ElseViewHelper.php (GitHub).
Arguments
The following arguments are available for <f:
:
if
-
- Type
- boolean
Condition expression conforming to Fluid boolean rules