View more context

 

theruss

Has anyone managed to integrate SVG uploads into the CMS, like "properly"? And I define "properly" as, I can upload an SVG and see a thumbnail in the UploadField and in the AssetAdmin?

Nick

Hi @theruss I've just joined this SS slack channel searching for the issue mentioned above

Nick

I belive this is also your situation?

theruss

Hi Nick, I've got this going - sort of.

theruss

What I can do:

• Upload .svg via assets admin • Upload .svg via UploadField • See a peview of the SVG within the SVG field

These were my only requirements.

What I can't do - because SVGs are vector graphics (XML files really) and not raster graphics:

• Resize • Scale • Generate custom thumbnails

theruss

For the latter points, you'd need to implement a separate Image class with alternatives for all the image-manipulation features you'd like to see.

theruss

FYI this package (https://github.com/restruct/silverstripe-svg-images) Allows limited SVG manipulation

Show 1 attachment(s)
GitHub  
restruct/silverstripe-svg-images

Basic SVG Image support for Silverstripe (Uploads/Assets) - restruct/silverstripe-svg-images

Hide attachment content
Nick

Hi! and thank you for reply. My problem is that since upgrading to SS 4.4 that thumbnail doesn't show up on first load of page. And my guess is that route is not found as it was in earlier version I had before (SS4.2.1) and I think is related to entwine library. I thought you have the same problem. Am I wrong?

theruss

No I don't have this problem. Mine was only ever a CMS thumbnail problem

Nick

thanx! I think it's from SS crazy assets!!! 🤦‍♂️ (folder rights)


Show less replies
theruss

Forgive me, I may have asked this before. Just coming back to it now.

muskie9

I've gotten the upload, but don't think I ever got a preview though...

Rathai

Hi. Does anyone have solution for adding multiple file upload field in custom form.

muskie9

may be based on how SS views it as a "File" vs "Image"

muskie9

if you find a way to do a preview it'd definitely be worth posting... pretty sure it's been brought up a few times

👍 (1)
John Lombardo

I’ve got a timestamp from an API and I want to display it formatted in two different ways in the template. Should I format it in the controller or create a DBDate instance and format it in the template?