简体   繁体   English

TYPO3作物品种和水分

[英]TYPO3 cropVariants and Fluid

Since TYPO3 8.7 has a nice cropVariants option for responsive images, I wonder how to best implement this: 由于TYPO3 8.7具有用于响应图像的不错的cropVariants选项,因此我想知道如何最好地实现这一点:

In an example on stackoverflow documentation 'image-cropping-typo3-8-7-lts' (not allowed to link it) some tsconfig is made to enable cropping variants. 在stackoverflow文档'image-cropping-typo3-8-7-lts'(不允许链接)的示例中,做了一些tsconfig来启用裁剪变体。

Then it will be available for all images in the content elements, how to best adjust the fluid styled content templates? 然后它将可用于内容元素中的所有图像,如何最好地调整流体样式的内容模板?

For example fluid_styled_content/Resources/Private/Partials/Media/Type/Image.html points to fluid_styled_content/Resources/Private/Partials/Media/Rendering/Image.html, which contains 例如,fluid_styled_content / Resources / Private / Partials / Media / Type / Image.html指向fluid_styled_content / Resources / Private / Partials / Media / Rendering / Image.html,其中包含

<f:media class="image-embed-item" file="{file}" width="{dimensions.width}" height="{dimensions.height}" alt="{file.alternative}" title="{file.title}" />

Does anyone has an example how to replace this particular part? 有没有人举过一个例子,如何替换这个特定部分? Or is it possible to allow cropping variants only for a custom content element? 还是仅允许自定义内容元素允许裁剪变体?

You have to add you CropVariant as attribute in your image viewhelper - with f:media it don't work i think... 您必须在图像viewhelper中将CropVariant添加为属性-使用f:media无效,我认为...

eg: 例如:

<f:image src="{uid}" treatIdAsReference="1" cropVariant="smartphone" maxWidth="{imagemaxwidth}" maxHeight="{imagemaxheight}" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM