如果是第一个,则覆盖图像标签?

发布于 2025-02-04 07:13:51 字数 383 浏览 4 评论 0原文

我正在使用“ CSS样式内容”的Typo3 7.6。

我要做的是覆盖IMG标签,如果它是内容元素中列出的第一张图像。

下添加了一个自定义IMG标签

因此,我在tt_content.image.20.1.1.1.1.1.1.1.1.1.custom 是第一张图片吗?

例如:

tt_content.image.20.1.1.layoutKey.override = custom
tt_content.image.20.1.1.layoutKey.override.if {
    value = 1
    equals.field = imageOrderNumber??
}

还是还有另一种方法?

I am using TYPO3 7.6 with 'CSS Styled Content'.

What I want to do is override the img tag if it is the first image listed in the content element.

So I have added a custom img tag under tt_content.image.20.1.1.layout.custom

Now how do I override tt_content.image.20.1.1.layoutKey if it is the first image?

Eg:

tt_content.image.20.1.1.layoutKey.override = custom
tt_content.image.20.1.1.layoutKey.override.if {
    value = 1
    equals.field = imageOrderNumber??
}

Or is there another way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疧_╮線 2025-02-11 07:13:51

有一个包含当前图像号的寄存器:寄存器:image_num_current

因此,它应该像这样工作:

tt_content.image.20.1.1.layoutKey.override = custom
tt_content.image.20.1.1.layoutKey.override.if {
    value = 1
    equals.data = register:IMAGE_NUM_CURRENT
}

There is a register containing the current image number: register:IMAGE_NUM_CURRENT.

So it should work like this:

tt_content.image.20.1.1.layoutKey.override = custom
tt_content.image.20.1.1.layoutKey.override.if {
    value = 1
    equals.data = register:IMAGE_NUM_CURRENT
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文