如何在TypoScript中执行裁剪设置?

时间:2015-11-20 09:58:04

标签: typo3 typoscript

我正在使用TYPO3 7并希望在此media代码段中应用TypoScript字段的裁剪设置:

lib.backgroundimage = FILES 
lib.backgroundimage {
    references.data =  levelmedia:-1, slide
    references.listNum = 0
    renderObj = IMG_RESOURCE
    renderObj.altText.data = file:current:description
    renderObj.file {
        import.data = file:current:publicUrl
        width = 1920
        height = 600c
    }
}

我该怎么做?

2 个答案:

答案 0 :(得分:0)

crop.data = file:current:crop是关键

您的完整代码:

lib.backgroundimage = FILES 
    lib.backgroundimage {
    references.data =  levelmedia:-1, slide
    references.listNum = 0
    renderObj = IMG_RESOURCE
    renderObj.altText.data = file:current:description
    renderObj.file {
        import.data = file:current:publicUrl
        crop.data = file:current:crop
        width = 1920
        height = 600c
    }
}

答案 1 :(得分:-2)

尝试使用CSS样式内容中的file.import.data = file:current:uid。 另请参阅有关此内容的文档,其中说明了裁剪设置已自动导入:https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/7.2/Feature-65584-AddImageCropping.html