0

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?

Allow also SVG to Upload

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>

no SVG image availible

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 .. image path correct

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

user2310852
  • 1,654
  • 1
  • 25
  • 52
  • Is the path to the file correct? Maybe the location ``uploads/tx_myext`` is stored in the database und must not be set in the viewhelper. Debug the variables using ``{_all}`` somewhere in the template, it displays all available variables and their values. – Merec Aug 26 '15 at 13:54
  • Hi merec, the path is correct. look at my EDIT 2 ... – user2310852 Aug 26 '15 at 14:32
  • But the path to the image in the output is now shown. There is a bug with svgs, see https://forge.typo3.org/issues/66445 – Merec Aug 26 '15 at 14:47
  • Oh, yes .. I see it at `typo3/sysext/core/Classes/Type/File/FileInfo.php` :: L31 `// @todo will be implemented in issue #60019` Hope that solve my problem ... – user2310852 Aug 26 '15 at 15:06
  • Oha .. I see the TagretVersion at your Fourge-Link is TYPO3 CMS 7. I'm using TYPO3 6.2.14. Do I need an update from 6.2 to 7.x to solve the Problem? Or maybe I'll use my SVG-Images as a `backgeound-image`?! – user2310852 Aug 27 '15 at 09:57
  • I would use ```` instead of `` – Merec Aug 27 '15 at 14:47
  • Yeah, that works. Thank you. I've tried it with the `vhs`and `fluid`ViewHelper, but not with the inline-notation. You can also use CSS to give the SVG Image a height and width. This also works for me. – user2310852 Aug 27 '15 at 18:31

1 Answers1

0

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" />
Community
  • 1
  • 1
user2310852
  • 1,654
  • 1
  • 25
  • 52
  • its better practice to used media exist or not? You can check here : https://fluidtypo3.org/viewhelpers/vhs/1.3.1/Media/ExistsViewHelper.html – Vishal Tanna Sep 02 '15 at 05:15