【问题标题】:How to perform crop settings in TypoScript?如何在 TypoScript 中执行裁剪设置?
【发布时间】:2015-11-20 09:58:04
【问题描述】:

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

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

我该怎么做?

【问题讨论】:

    标签: typo3 typoscript


    【解决方案1】:

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

    【讨论】:

    • 在 TYPO3 8 中,宽度和高度设置将覆盖裁剪数据。我需要它反过来,宽度和高度只是后备。有什么提示吗?
    • 我也在这里发布了这个问题:stackoverflow.com/questions/48584655/…
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-13
      • 1970-01-01
      • 2015-07-08
      • 1970-01-01
      • 1970-01-01
      • 2012-10-05
      • 1970-01-01
      相关资源
      最近更新 更多