0

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

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
        }
    }
}

我尝试了其他几种方法来查找标题,但均未成功。

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

提前非常感谢!

4

1 回答 1

2

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

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

stdWrap.outerWrap.cObject = TEXT
stdWrap.outerWrap.data = debug:register
于 2014-11-22T10:42:16.753 回答