FluidTYPO3与SVG图像的ViewHelper? [英] FluidTYPO3 vhs ViewHelper for SVG Images?

查看:96
本文介绍了FluidTYPO3与SVG图像的ViewHelper?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用TYPO3 CMS 6.2.14,vhs 2.3.3Flux 7.2.1FluidContent 4.3.1-我的TYPO3编辑器需要有机会通过vhs -ViewHelper上传SVG图像.我创建了一个新的 FluidTYPO3 内容元素(FCE),但是前端没有可见的SVG图像.嗯?

I use TYPO3 CMS 6.2.14, vhs 2.3.3, Flux 7.2.1 and FluidContent 4.3.1 - my TYPO3 Editor need the opportunity to upload SVG-Images via vhs-ViewHelper. I've made a new FluidTYPO3 Content Element (FCE), but there's no SVG Image visible in frontend. Mmhh?

Flux-FlexForm

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条目,但没有成功.我的错在哪里此ViewHelper是否需要heightwidth? vhs中没有可用的向量吗?

Also I use the htaccess entry, but there is no success. Where's my fault? Do I need heightand widthfor this ViewHelper? Aren't vectors availible in vhs?

<IfModule mod_mime.c>
    ...
    AddType image/svg+xml                   svg svgz
    AddEncoding gzip                        svgz
    ...
</Ifmodule>

我也尝试了Fluid ViewHelper,但是SVG图像具有height/width = 0:

I also tried the Fluid ViewHelper, but the SVG Image has height/width = 0:

<f:image src="uploads/tx_myext/{imgIcon}" width="50" height="50" class="xy" alt="Icon" />

ImagePath是正确的.在开发人员工具中,我看到"了图像..

EDIT 2: The ImagePath is correct. At Developer Tools I "see" the Image ..

哦,我在Filemanager(FAL)中看到0x0 pixels ..

EDIT 3: Oh, I see at my Filemanager (FAL) 0x0 pixels ..

推荐答案

感谢 merec .

将SVG图像/TYPO3 6.2与FluidTYPO3一起使用

Use SVG Images / TYPO3 6.2 with FluidTYPO3

答案:使用

<img src="{f:uri.image(src: 'uploads/tx_myext/{imgIcon}')}">

代替

<v:media.image src="uploads/tx_myext/{imgIcon}" alt="Icon" />
// OR
<f:image src="uploads/tx_myext/{imgIcon}" width="50" height="50" class="xy" alt="Icon" />

这篇关于FluidTYPO3与SVG图像的ViewHelper?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆