typo3 - Typo3 用本地文件夹路径中的大数据 URL 替换大外部图像的 src
问题描述
Typo3 用本地文件夹路径中的大数据 URL 替换大外部图像的 src。路径:typo3conf/ext/bootstrap_package/Resources/Private/Partials/ContentElements/Media/Rendering/Image.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<img src="{f:uri.image(src: 'EXT:bootstrap_package/Resources/Public/Images/blank.gif')}" data-src="{f:uri.image(image: file)}" data-large="{f:uri.image(image: file, cropVariant: 'default', maxWidth: 1140)}" data-medium="{f:uri.image(image: file, cropVariant: 'medium', maxWidth: 940)}" data-small="{f:uri.image(image: file, cropVariant: 'small', maxWidth: 720)}" data-extrasmall="{f:uri.image(image: file, cropVariant: 'extrasmall', maxWidth: 320)}" title="{file.title}" alt="{file.alternative}" class="lazyload" data-preload="{f:if(condition: settings.preload.images, then: 'true', else: 'false')}" />
<noscript>
<img src="{f:uri.image(image: file)}" title="{file.title}" alt="{file.alternative}" />
</noscript>
</html>
<img src="/typo3k/fileadmin/_processed_/c/6/csm_Namibia__6__01_bf7ab3fa07.jpg" data-src="https://media.........../view/14fd891e99c67dfc2d475aded2f38d3b389811" data-large="/typo3k/fileadmin/_processed_/c/6/csm_Namibia__6__01_bf7ab3fa07.jpg" data-medium="/typo3k/fileadmin/_processed_/c/6/csm_Namibia__6__01_2ea86b1ad4.jpg" data-small="/typo3k/fileadmin/_processed_/c/6/csm_Namibia__6__01_a5c4bf8281.jpg" data-extrasmall="/typo3k/fileadmin/_processed_/c/6/csm_Namibia__6__01_03571e8240.jpg" title="" alt="" class="lazyload" data-preload="false" style="opacity: 1;">
该问题仅发生在大图像文件中,对于小图像,它的工作正常,显示 src 属性的外部链接和大数据。
对于小型 720 X ...图像其工作在视图中显示 html,例如
<img src="https://media............../view/11ca5ff84cdb906c5427d87bb3bd383e389813" data-src="https://media.............../view/11ca5ff84cdb906c5427d87bb3bd383e389813" data-large="https://.................../view/11ca5ff84cdb906c5427d87bb3bd383e389813" data-medium="https://media................../view/11ca5ff84cdb906c5427d87bb3bd383e389813" data-small="/typo3k/fileadmin/_processed_/5/9/csm_Namibia__6__c0a95f8209.jpg" data-extrasmall="/typo3k/fileadmin/_processed_/5/9/csm_Namibia__6__75677ed405.jpg" title="" alt="" class="lazyload" data-preload="false" style="opacity: 1;">
请帮助我打字3 8.7版本我正在工作。
解决方案
尝试这个:
<img
src="{f:uri.image(src: 'EXT:bootstrap_package/Resources/Public/Images/blank.gif')}"
data-src="{f:uri.image(image: file, maxHeight:dimensions.height, maxWidth: dimensions.width, treatIdAsReference:1)}"
data-large="{f:uri.image(image: file,treatIdAsReference:'1', cropVariant: 'default', maxWidth: 1140)}"
data-medium="{f:uri.image(image: file, treatIdAsReference:'1', cropVariant: 'medium', maxWidth: 940)}"
data-small="{f:uri.image(image: file, treatIdAsReference:'1', cropVariant: 'small', maxWidth: 720)}"
data-extrasmall="{f:uri.image(image: file, treatIdAsReference:'1', cropVariant: 'extrasmall', maxWidth: 320)}"
title="{file.title}" alt="{file.alternative}"
class="lazyload"
data-preload="{f:if(condition: settings.preload.images, then: 'true', else: 'false')}"
/>
我添加了treatIdAsReference 参数。你对图像处理有任何限制吗?
推荐阅读
- html - 如何更改蓝图菜单项的默认行为?
- python - xtick 标签如何引用标签而不是索引号?
- javascript - Firebase 上传未获取下载 URL
- python - .csv 文件包含多项式方程的解
- python - 从 Python 扩展模块返回一个字符数组
- python - pandas 由函数输出替换(将函数应用于基于正则表达式的行)
- php - OpenCart OCMOD 和 VQMOD 修改系统
- python-3.x - pandas 比较两个不同大小的数据帧映射值,并在缺失值时添加任意值
- python - 使用 Python 使用相对文件路径打开 csv
- c - 我在输出的末尾得到了 printf 行内的所有行