【发布时间】:2015-11-20 13:47:03
【问题描述】:
我使用 TYPO3 CMS 6.2.14、vhs 2.3.3、Flux 7.2.1 和 FluidContent 4.3.1 - 我的 TYPO3 编辑器需要有机会通过 vhs-ViewHelper 上传 SVG 图像。我制作了一个新的 FluidTYPO3 内容元素 (FCE),但在前端看不到 SVG 图像。嗯?
Flux-FlexForm
<flux:field.file name="imgIcon" allowed="jpg,gif,png,jpeg,svg" uploadFolder="uploads/tx_myext" minItems="0" maxItems="1" size="1" />
...
<v:media.image src="uploads/tx_myext/{imgIcon}" alt="Icon" />
输出
<div class="small-2 columns">
<img alt="Icon" src="" width="" height="">
</div>
我也使用了 htaccess 条目,但没有成功。我的错在哪里?我需要 height 和 width 这个 ViewHelper 吗? vhs 中没有矢量可用吗?
<IfModule mod_mime.c>
...
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
...
</Ifmodule>
编辑:我也尝试过 Fluid ViewHelper,但 SVG 图像有 height/width = 0:
<f:image src="uploads/tx_myext/{imgIcon}" width="50" height="50" class="xy" alt="Icon" />
【问题讨论】:
-
文件路径是否正确?也许位置
uploads/tx_myext存储在数据库中,不能在viewhelper 中设置。使用模板中某处的<f:debug>{_all}</f:debug>调试变量,它会显示所有可用的变量及其值。 -
您好 merec,路径是正确的。看看我的 EDIT 2 ...
-
但现在显示输出中图像的路径。 svgs 有一个错误,请参阅forge.typo3.org/issues/66445
-
哦,是的..我在
typo3/sysext/core/Classes/Type/File/FileInfo.php::L31// @todo will be implemented in issue #60019看到它希望能解决我的问题... -
哦 .. 我看到您 Fourge-Link 上的 TagretVersion 是 TYPO3 CMS 7。我使用的是 TYPO3 6.2.14。我是否需要从 6.2 更新到 7.x 才能解决问题?或者,也许我会将我的 SVG 图像用作
backgeound-image?!
标签: svg typo3 fluid flux viewhelper