TYPO3 10.3 前端的用户名 [英] Username in frontend in TYPO3 10.3
问题描述
在 TYPO3 9 中,我设法使用以下 Typoscript 在 FLUID 模板中显示当前用户名:
In TYPO3 9 I managed to display the current username in a FLUID-template with the following Typoscript:
[loginUser=*]
temp.username = TEXT
temp.username {
insertData = 1
value = {TSFE:fe_user|user|username}
noTrimWrap = | ||
}
[global]
在 TYPO3 10.4 中,这不再起作用.知道如何显示当前用户吗?非常感谢!我们
In TYPO3 10.4 this is not working anymore. Any idea how to display the current user? Many thanks! Urs
推荐答案
它可能不起作用,因为您使用的是旧的 TypoScript 条件.从 TYPO3 9 开始,条件适用于 Symfony 表达式.旧条件在 TYPO3 9 中已弃用(但仍然有效)并在 TYPO3 10 中删除.因此 [loginUser=*]
在 TYPO3 10 中永远不会成立.您应该使用 [frontend.user.isLoggedIn]
代替.
It's probably not working because you're using the old TypoScript conditions. Since TYPO3 9 the conditions work with Symfony expressions. The old conditions were deprecated in TYPO3 9 (but still worked) and removed in TYPO3 10. So [loginUser=*]
will never be true in TYPO3 10. You should use [frontend.user.isLoggedIn]
instead.
参见 https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Conditions/Index.html 了解有关新 TypoScript 条件的更多信息.
See https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Conditions/Index.html for more about the new TypoScript conditions.
这篇关于TYPO3 10.3 前端的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!