使用拼写错误自动填充带有图像文件名称的“alt”文本?

Auto-fill “alt”-text with imagefile name by using typoscript?

我想为使用打字错误从 TYPO3 后端包含的所有图像添加替代文本。

<img title="ABC" alt="....." src="fileadmin/uploads/abc/nature.jpg">

如果有人对此有答案,请分享。

您可以在模板设置文件中使用以下打字代码自动为 fal 或 rte 上传的所有图像添加替代文本。

temp.altText >
temp.altText < tt_content.image.20.1.altText
tt_content.image.20.1.altText >
tt_content.image.20.1.altText.cObject = COA
tt_content.image.20.1.altText.cObject {
    10 < temp.altText
    20 = TEXT
    20 {
        noTrimWrap = | | |
        data = file:current:name
    }
}

if you want to add page title in alt text of images then use below code

temp.altText >
temp.altText < tt_content.image.20.1.altText
tt_content.image.20.1.altText >
tt_content.image.20.1.altText.cObject = COA
tt_content.image.20.1.altText.cObject {
    10 < temp.altText
    20 = TEXT
    20 {
        noTrimWrap = | | |
        data = page:title
    }
}