打字脚本中的TYPO3常量和条件
我有打字脚本中的TYPO3常量和条件,typo3,constants,typo3-8.7.x,Typo3,Constants,Typo3 8.7.x,我有constants.ts文件,其中定义了我的所有常量。还有一个简单的布尔复选框: plugin.mycustompage { top_header { # cat=mycustompage.top_header/privateNumberShow/010; type=boolean; label=Private - show phone number: boolean true or false privateNumberShow = 1 # cat=mycust
constants.ts
文件,其中定义了我的所有常量。还有一个简单的布尔复选框:
plugin.mycustompage {
top_header {
# cat=mycustompage.top_header/privateNumberShow/010; type=boolean; label=Private - show phone number: boolean true or false
privateNumberShow = 1
# cat=mycustompage.top_header/privatePhoneNumber/010; type=string; label=Private - phone number
privatePhoneNumber = 11223344
}
}
除此之外,在lib/contactinfo.ts
文件中还有一个简单的文件,我想根据privateNumberShow
常量值显示/隐藏一些文本。如果未选中该复选框,则清除该值,否则显示该值。以下是当前代码:
[globalVar = LIT:0 = {$plugin.mycustompage.top_header.privateNumberShow}]
lib.contactInfo.20 >
[END]
那不行。也尝试过同样不起作用的:
[$plugin.mycustompage.top_header.privateNumberShow = 0]
lib.contactInfo.20 >
[END]
使用TYPO3 8.7.12。有什么想法吗?改变你的状况,请求LIT:1
。这样,当常量不是1时,打字脚本解析器不需要解析contactInfo,这将有助于提高性能
[globalVar = LIT:1 = {$plugin.mycustompage.top_header.privateNumberShow}]
lib.contactInfo.20 = TEXT
lib.contactInfo.20{
value = 123456789
}
[global]
切换您的状况并请求LIT:1
。这样,当常量不是1时,打字脚本解析器不需要解析contactInfo,这将有助于提高性能
[globalVar = LIT:1 = {$plugin.mycustompage.top_header.privateNumberShow}]
lib.contactInfo.20 = TEXT
lib.contactInfo.20{
value = 123456789
}
[global]
奇怪,但它实际上像一个符咒!谢谢:)奇怪,但它实际上就像一个符咒!谢谢:)