Typo3 fluid: Check if a page ID is active or visible
(Last Updated On: February 12, 2018) There is no direct way to this with fluid, but there is a workaround that we can use. We just need to try to make a URI with f:uri.page
, this will return an empty string if the id is not active. In the Fluid World an empty string is “false”.
Ad:
<f:if condition="{f:uri.page(pageUid: 115)}">
<f:then>
The page with id 115 is visible.
</f:then>
<f:else>
The page with id 115 is NOT visible. I will show something else.
</f:else>
</f:if>
A smart solution, thank you.
this works in pure frontend context, but wont work with the preview mode, at least with typo3 v9. My solution with the vhs extension installed:
maybe helps if someone needs it working in preview-mode too.
Cool! Thanks for your tip. I haven’t work with Typo3 in a long time.