Last active
September 30, 2024 15:25
-
-
Save Bjoelin/0c803af3f3b8f420e91f4adb07fe01a5 to your computer and use it in GitHub Desktop.
How to check if a page is within the rootline of another page in TYPO3 Fluid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<f:comment>Regular syntax</f:comment> | |
<v:condition.iterator.contains needle="<the page id>" haystack="{v:page.rootline() -> v:iterator.extract(key: 'uid')}"> | |
<f:then></f:then> | |
<f:else></f:else> | |
</v:condition.iterator.contains> | |
<f:comment>Inline syntax</f:comment> | |
{v:condition.iterator.contains( | |
needle: item.uid, | |
haystack: '{v:page.rootline() -> v:iterator.extract(key: \'uid\')}', | |
then: 'foo', | |
else: 'bar' | |
)} | |
Credits to Sven Wappler | |
https://www.wapplersystems.de/blog/typo3-pidinrootline-fluid-style/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New URL for credits by Sven Wappler:
https://blog.wappler.systems/typo3-pidinrootline-fluid-style/