String comparison in Fluid since TYPO3 6.1 (in case you missed it like I did)

When searching the Internet for how to compare two strings in TYPO3’s templating engine Fluid, you will still find a lot of pages telling you to do it this way:

Basically you had to create two single valued arrays and compare their values. This has always been an awkward workaround. But over the time you got used to it.

But today I realized that this is not up-to-date anymore – in fact for quite some time. Already since version 6.1 of TYPO3 CMS string comparison in Fluid is more like you’d expect it to be:

Clean and natural, as this example taken from the comments of the current Fluid IfViewHelper shows.

Strange thing is that even official TYPO3/Fluid documentation doesn’t necessarily tell you about this change (like e.g. the TYPO3Wiki, from where the first example was taken), what might have caused me (and others probably, too) to overlook it. So I hope this post will help to spread the word about this small, but noteworthy fact.

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)