Typo3 fluid: Check if a page ID is active or visible

/ November 22, 2017/ Typo3

(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>
Spread the love
Subscribe
Notify of
guest
3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Michael
Michael
2 years ago

A smart solution, thank you.

johannes
johannes
7 months ago

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:

<f:if condition="{v:page.info(pageUid: '123', field: 'hidden')}==0">

maybe helps if someone needs it working in preview-mode too.