【问题标题】:TYPO3 fluid f:image without width/height attribute / f:uri.image issuesTYPO3 流体 f:image 没有宽度/高度属性 / f:uri.image 问题
【发布时间】:2017-11-30 11:47:14
【问题描述】:

我在让{f:uri.image} 工作时遇到了一些问题,这不会呈现:

<img src="{f:uri.image(src:person.firstImage,treatIdAsReference:1, width:150c,height:150c,cropVariant:'square')}"/>

person.firstImage 的类型为 TYPO3\CMS\Extbase\Domain\Model\FileReference

也许你发现了错误?

另一方面,这是可行的:

<f:image class="image-author" image="{person.firstImage}" width="150c" height="150c" cropVariant="square"/>

... 但是输出将始终具有width="150" height="150" html 属性,这将与响应式 CSS 冲突。

有没有办法防止f:image 在源标签中输出 with 和 height ?如果我查看the VH,可能不会?

【问题讨论】:

    标签: typo3 fluid typo3-8.x


    【解决方案1】:

    添加c时需要对宽高进行转义

    <img src="{f:uri.image(src:person.firstImage,treatIdAsReference:1, width:'150c',height:'150c',cropVariant:'square')}"/>

    也会去:

    <img src="{f:uri.image(image:person.firstImage,width:'150c',height:'150c',cropVariant:'square')}"/>

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-19
    • 2021-10-27
    • 1970-01-01
    • 2023-03-27
    • 2012-08-07
    • 1970-01-01
    • 2013-05-25
    • 1970-01-01
    相关资源
    最近更新 更多