Phil
Phil

Reputation: 182

TypoScript condition in frontend context (9.5 LTS, expression syntax) for backend users logged in

Heyho, I’m playing with the new expression syntax in TYPO3 CMS 9.5 LTS. I'm trying to display something in FE when user has an active BE login. The feature rst suggests:

[backend.user.isLoggedIn == true]
...
[END]

and it should work?! but does not work and throws:

TYPO3 Deprecation Notice: The old condition syntax will be removed in TYPO3 v10.0, use the new expression language. Used condition: [backend.user.isLoggedIn === true]

[getTSFE().beUserLogin > 0]
...
[END]

works but throws: TYPO3 Deprecation Notice: Property $TSFE->beUserLogin is not in use anymore as this information is now stored within the backend.user aspect.

So what’s wrong here?

Upvotes: 1

Views: 790

Answers (1)

Ben
Ben

Reputation: 1021

With TYPO3 version < 9.5.16 the object "backend" is only available in BE (TSconfig).

For frontend (TS Setup) you might use [getTSFE() && getTSFE().isBackendUserLoggedIn()].

Starting with TYPO3 version 9.5.16, which was released on 28.4.2020 and contains the bugfix "Make backend.user conditions in FE work", the following condition can now also be used:

[backend.user.isLoggedIn]

Upvotes: 2

Related Questions