TYPO3 6.2/TypoScript:如果标题不为空,则将CSS类添加到figure标记中

TYPO3 6.2/TypoScript:如果标题不为空,则将CSS类添加到figure标记中,typo3,typoscript,typo3-6.2.x,Typo3,Typoscript,Typo3 6.2.x,我将我的图像包装在图形标签中,并将相应的图像标题包装在figcaption中。现在,我只想在图像标题不是空的情况下向figure标记添加一个类。以下是我尝试的代码: tt_content.image.20 { renderMethod = figure rendering { figure { oneImageStdWrap.dataWrap = <figure> | </figure> on

我将我的图像包装在图形标签中,并将相应的图像标题包装在figcaption中。现在,我只想在图像标题不是空的情况下向figure标记添加一个类。以下是我尝试的代码:

tt_content.image.20 {
    renderMethod = figure
    rendering {
        figure {
            oneImageStdWrap.dataWrap = <figure> | </figure>
            oneImageStdWrap.dataWrap {
                override = <figure class="caption"> | </figure>
                override {
                    if.isTrue.caption
                }
            }
            caption.wrap = <figcaption> | </figcaption>
            caption.required = 1
        }
    }
}
tt_content.image.20{
renderMethod=图
渲染{
身材{
oneImageStdWrap.dataWrap=|
oneImageStdWrap.dataWrap{
覆盖=|
凌驾{
if.isTrue.caption
}
}
caption.wrap=|
caption.required=1
}
}
}
我尝试了其他几种方法来查找标题,但都没有成功

正如上面所写的,无论是否有标题,每个图形都会获得“caption”类。例如,使用
if.isTrue.field=caption
不会覆盖,因此会为每个图像返回


提前多谢

尝试使用
if.isTrue.data=register:allImageCaptions
呈现字幕。 由于FAL数据可能来自多个源,因此它被放入每个映像的寄存器中,而不是像以前的版本那样提供数据库行

要查看所有寄存器,请使用

stdWrap.outerWrap.cObject = TEXT
stdWrap.outerWrap.data = debug:register