Typo3 类型3:条件“;如果列为空";?
我正在寻找一个条件来检查某个列是否为空 大概是这样的:Typo3 类型3:条件“;如果列为空";?,typo3,conditional-statements,typoscript,Typo3,Conditional Statements,Typoscript,我正在寻找一个条件来检查某个列是否为空 大概是这样的: [colPos.0 = empty] #do stuff [global] 提前谢谢 编辑: 我想我在找什么还不清楚。让我补充一些信息: 我在BE(colPos=0)中为一个摘要图像创建了一个列。如果它包含一个元素,它应该定期显示该元素。如果不是(=如果为空),则应使用另一个图像。您可以使用,示例(来自文档): 编辑:另外,如果您使用的是流体模板,您可以只使用f:if条件。当然可以显示内容,无论列是否包含内容, 但这不存在TS条件 基于,
[colPos.0 = empty]
#do stuff
[global]
提前谢谢
编辑:我想我在找什么还不清楚。让我补充一些信息: 我在BE(colPos=0)中为一个摘要图像创建了一个列。如果它包含一个元素,它应该定期显示该元素。如果不是(=如果为空),则应使用另一个图像。您可以使用,示例(来自文档):
编辑:另外,如果您使用的是流体模板,您可以只使用
f:if
条件。当然可以显示内容,无论列是否包含内容,
但这不存在TS条件
基于,以下是我的解决方案:
temp.foo {
temp.foo = COA
10 = COA
10 {
10 < styles.content.get
10.select.where = colPos=1
# conditional to test if content exists in column
if.isTrue.numRows {
# check current page page
pidInList = this
# in the table tt_content
table = tt_content
# colPos = 1
select.where = colPos=1
}
}
20 = COA
20 {
10 < lib.somethingElse
# conditional to test if content exists in column
if.isFalse.numRows {
# check current page page
pidInList = this
# in the table tt_content
table = tt_content
# colPos = 1
select.where = colPos=1
}
}
}
temp.foo{
温度foo=COA
10=COA
10 {
10
if.isTrue
和if.isFalse
在这里起作用
HTH谢谢您的快速回复。但我试图检查这些列的内容,看它们是否填充了内容元素。给我一分钟,我将编辑问题以获得更多许可。您使用哪种版本的TYPO3以及哪种模板引擎?也就是说,如果你使用流体-你可以只使用
f:if
条件,否则检查这个片段:@biesior好吧,我不知道如何使用你的片段,但它给了我另一个解决方案的想法。刚刚将
添加到我的流体模板中。谢谢!
temp.foo {
temp.foo = COA
10 = COA
10 {
10 < styles.content.get
10.select.where = colPos=1
# conditional to test if content exists in column
if.isTrue.numRows {
# check current page page
pidInList = this
# in the table tt_content
table = tt_content
# colPos = 1
select.where = colPos=1
}
}
20 = COA
20 {
10 < lib.somethingElse
# conditional to test if content exists in column
if.isFalse.numRows {
# check current page page
pidInList = this
# in the table tt_content
table = tt_content
# colPos = 1
select.where = colPos=1
}
}
}