Typo3 如何根据SQL检入脚本设置变量?
在我的打字稿代码中有一个数据库表tt_内容检查。 根据内容是否为空,我想将变量VAR设置为empty或full。 可能吗Typo3 如何根据SQL检入脚本设置变量?,typo3,typoscript,Typo3,Typoscript,在我的打字稿代码中有一个数据库表tt_内容检查。 根据内容是否为空,我想将变量VAR设置为empty或full。 可能吗 MIDCONTENT= CONTENT MIDCONTENT{ table = tt_content select.orderBy = sorting select.where = colPos = 0 } 我已经找到了一种方法,通过执行 MIDCONTENT= CONTENT MIDCONTENT{ table = tt_content selec
MIDCONTENT= CONTENT
MIDCONTENT{
table = tt_content
select.orderBy = sorting
select.where = colPos = 0
}
我已经找到了一种方法,通过执行
MIDCONTENT= CONTENT
MIDCONTENT{
table = tt_content
select.orderBy = sorting
select.where = colPos = 0
stdWrap.ifEmpty.cObject = TEXT
stdWrap.ifEmpty.cObject.value = empty
}
但我需要的是设置另一个变量,我也需要检查完整状态。您需要类似以下内容:
enable = 1
enable.if.isTrue.field = MIDCONTENT
我没有要测试的typo3安装。另外,你没有真正描述你想做什么。。。更多的细节可以帮助你更多。未经测试
如果我没听懂你的话,你想在ATagParams中添加一个class=full,前提是该页面中有tt_内容记录
NO.ATagParams.append = TEXT
NO.ATagParams.append {
value = class="full"
# Space before and after
noTrimWrap = | | |
if.isTrue.numRows {
table = tt_content
select {
where = colPos = 0
# the uid of the page, is the pid of the tt_content elements
pidInList.field = uid
}
}
}
如果该页上没有记录,numRows将返回0,因此If.isTrue将返回false,文本对象将不会被呈现。可能您问错人了。那是一个邮寄名单。打字脚本不是一种真正的语言。任务是:如果列0不是空的,则将class=full分配给变量。在java中是:ifcolPos0!={NO.ATagParams=class=full}我尝试过:stdWrap.if.isTrue.cObject=TEXT stdWrap.if.isTrue.cObject.value=dir-它不起作用检查此链接:将你的中间内容设置为COA,将你的代码放在10中并带有一个isTrue,用20<.10复制,并将20的isTrue更改为isFalse