1

我像这样覆盖图像操作的cropVariants:

https://docs.typo3.org/typo3cms/extensions/core/8.7/Changelog/8.7/Feature-79812-AllowOverridingCropVariantsForImageManipulation.html

但是如何根据流体中的特定cropVariant 渲染第一张图像?假设@media (max-width: 575px){} 的“移动”...?

模板中的调试显示第一个“创建新关系”媒体文件(jpg 图像)的裁剪如下:

<f:debug>{data}</f:debug>

array(85 items)
...
   media => array(1 item)
      0 => TYPO3\CMS\Core\Resource\FileReferenceprototypeobject
         propertiesOfFileReference => protectedarray(35 items)
            ...
            crop => '{"desktop":{"cropArea":{"x":0.011,"y":0,"width":0.924,"height":0.99047619047
               619},"selectedRatio":"NaN","focusArea":null},"mobile":{"cropArea":{"x":0.094,"y":1.917337540
               94e-15,"width":0.786,"height":0.99809523809524},"selectedRatio":"3:2","focus
               Area":null}}' (392 chars)
...
4

1 回答 1

1
<f:image
    src="{image.0.uid}"
    treatIdAsReference="1"
    width="1140"
    height="375"
    cropVariant="desktop"
/>
于 2017-10-27T10:08:46.167 回答