FluidTYPO3 vhs ViewHelper for SVG Images?

2019-09-18 18:47发布

问题:

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