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.
Security.ifAuthenticated ViewHelper <f:security.ifAuthenticated>
This ViewHelper implements an ifAuthenticated/else condition for frontend users.
Examples
Basic usage
<f:security.ifAuthenticated>
This is being shown whenever a FE user is logged in
</f:security.ifAuthenticated>
Everything inside the <f:
tag is being displayed if
current frontend user is authenticated.
IfAuthenticated / then / else
<f:security.ifAuthenticated>
<f:then>
This is being shown in case you have access.
</f:then>
<f:else>
This is being displayed in case you do not have access.
</f:else>
</f:security.ifAuthenticated>
Everything inside the <f:
tag is displayed if frontend user is authenticated.
Otherwise, everything inside the <f:
tag is displayed.
Source code
Go to the source code of this ViewHelper: IfAuthenticatedViewHelper.php (GitHub).
Arguments
The following arguments are available for <f:
:
then
-
- Type
- mixed
Value to be returned if the condition if met.
else
-
- Type
- mixed
Value to be returned if the condition if not met.