我在{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
源标签中的和高度一起输出?如果我查看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')}"/>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句