FluidTYPO3 vhs ViewHelper for SVG Images?

﹥>﹥吖頭↗ 提交于 2019-12-12 00:55:01

问题


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: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" />

Output

<div class="small-2 columns">
  <img alt="Icon" src="" width="" height="">
</div>

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>

EDIT: 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" />

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

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


回答1:


Thanks merec.

Use SVG Images / TYPO3 6.2 with FluidTYPO3

Answer: Use

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

instead of

<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" />


来源:https://stackoverflow.com/questions/32228003/fluidtypo3-vhs-viewhelper-for-svg-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!