Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
打字脚本中的TYPO3常量和条件_Typo3_Constants_Typo3 8.7.x - Fatal编程技术网

打字脚本中的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]

奇怪,但它实际上像一个符咒!谢谢:)奇怪,但它实际上就像一个符咒!谢谢:)