Typo3流体F:无宽度 /高度属性 / F:URI.图像问题的图像



我遇到一些麻烦,让{f:uri.image}工作,这不会呈现:

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

person.firstImage是类型TYPO3CMSExtbaseDomainModelFileReference

也许您发现错误?

另一方面,这有效:

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

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

有没有办法防止f:image输出和源标签中的高度?可能不是,如果我看VH?

添加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')}"/>

最新更新