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?
Hi @theruss I've just joined this SS slack channel searching for the issue mentioned above
I belive this is also your situation?
Hey @theruss any news on the above?
Hi Nick, I've got this going - sort of.
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
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.
FYI this package (https://github.com/restruct/silverstripe-svg-images) Allows limited SVG manipulation
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?
No I don't have this problem. Mine was only ever a CMS thumbnail problem
Sorry I can't be of more help.
thanx! I think it's from SS crazy assets!!! 🤦♂️ (folder rights)
Forgive me, I may have asked this before. Just coming back to it now.
I've gotten the upload, but don't think I ever got a preview though...
Hi. Does anyone have solution for adding multiple file upload field in custom form.
may be based on how SS views it as a "File" vs "Image"
Yeah - I've got as far as you then.
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
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?
I’ve tried using
DBDate::create($timestamp) in the controller but I don’t think that is working.